diff options
Diffstat (limited to 'tests/quicktestbrowser')
-rw-r--r-- | tests/quicktestbrowser/BrowserWindow.qml | 10 | ||||
-rw-r--r-- | tests/quicktestbrowser/FullScreenNotification.qml | 99 | ||||
-rw-r--r-- | tests/quicktestbrowser/quicktestbrowser.pro | 3 | ||||
-rw-r--r-- | tests/quicktestbrowser/resources.qrc | 1 |
4 files changed, 111 insertions, 2 deletions
diff --git a/tests/quicktestbrowser/BrowserWindow.qml b/tests/quicktestbrowser/BrowserWindow.qml index ca0b6499b..3fcca4aab 100644 --- a/tests/quicktestbrowser/BrowserWindow.qml +++ b/tests/quicktestbrowser/BrowserWindow.qml @@ -61,8 +61,10 @@ ApplicationWindow { // This is for the case where the system forces us to leave fullscreen. if (currentWebView && !isFullScreen) { currentWebView.state = "" - if (currentWebView.isFullScreen) + if (currentWebView.isFullScreen) { currentWebView.fullScreenCancelled() + fullScreenNotification.hide() + } } } @@ -397,9 +399,11 @@ ApplicationWindow { webEngineView.state = "FullScreen" browserWindow.previousVisibility = browserWindow.visibility browserWindow.showFullScreen() + fullScreenNotification.show() } else { webEngineView.state = "" browserWindow.visibility = browserWindow.previousVisibility + fullScreenNotification.hide() } request.accept() } @@ -502,6 +506,10 @@ ApplicationWindow { } } + FullScreenNotification { + id: fullScreenNotification + } + DownloadView { id: downloadView visible: false diff --git a/tests/quicktestbrowser/FullScreenNotification.qml b/tests/quicktestbrowser/FullScreenNotification.qml new file mode 100644 index 000000000..80a63d479 --- /dev/null +++ b/tests/quicktestbrowser/FullScreenNotification.qml @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.5 + +Rectangle { + id: fullScreenNotification + width: 500 + height: 40 + color: "white" + radius: 7 + + visible: false + opacity: 0 + + function show() { + visible = true + opacity = 1 + reset.start() + } + + function hide() { + reset.stop() + opacity = 0 + } + + Behavior on opacity { + NumberAnimation { + duration: 750 + onStopped: { + if (opacity == 0) + visible = false + } + } + } + + Timer { + id: reset + interval: 5000 + onTriggered: hide() + } + + anchors.horizontalCenter: parent.horizontalCenter + y: 125 + + Text { + id: message + width: parent.width + + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + + wrapMode: Text.WordWrap + elide: Text.ElideNone + clip: true + + text: qsTr("You are now in fullscreen mode. Press ESC to quit!") + } +} diff --git a/tests/quicktestbrowser/quicktestbrowser.pro b/tests/quicktestbrowser/quicktestbrowser.pro index 7d6dfa6df..996e82a63 100644 --- a/tests/quicktestbrowser/quicktestbrowser.pro +++ b/tests/quicktestbrowser/quicktestbrowser.pro @@ -14,7 +14,8 @@ OTHER_FILES += ApplicationRoot.qml \ ButtonWithMenu.qml \ ContextMenuExtras.qml \ DownloadView.qml \ - FeaturePermissionBar.qml + FeaturePermissionBar.qml \ + FullScreenNotification.qml RESOURCES += resources.qrc diff --git a/tests/quicktestbrowser/resources.qrc b/tests/quicktestbrowser/resources.qrc index 80f1d1543..2dcda4d0d 100644 --- a/tests/quicktestbrowser/resources.qrc +++ b/tests/quicktestbrowser/resources.qrc @@ -5,6 +5,7 @@ <file>BrowserWindow.qml</file> <file>ContextMenuExtras.qml</file> <file>FeaturePermissionBar.qml</file> + <file>FullScreenNotification.qml</file> <file>ButtonWithMenu.qml</file> <file>DownloadView.qml</file> <file>ZoomController.qml</file> |