summaryrefslogtreecommitdiffstats
path: root/tests/quicktestbrowser/BrowserWindow.qml
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2015-03-02 08:00:59 -0800
committerSzabolcs David <davidsz@inf.u-szeged.hu>2015-03-09 11:54:11 +0000
commit769b3a61f5d2abcb3f694ade95e1e8f1c505b75a (patch)
tree593d303493d3b771c32438cf12a44b34c4eff819 /tests/quicktestbrowser/BrowserWindow.qml
parent42c39d0545ee98feccf6d8059aee082c47a8e730 (diff)
Promote fullscreen API to 5.5 public
Introduce a new FullScreenRequest object as the parameter of the fullScreenRequested signal and expose the isFullScreen property as read-only. This makes the API harder to misuse. Change-Id: Ibb072ec93843e6df265bd930e8721d244bc2f4bc Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'tests/quicktestbrowser/BrowserWindow.qml')
-rw-r--r--tests/quicktestbrowser/BrowserWindow.qml33
1 files changed, 19 insertions, 14 deletions
diff --git a/tests/quicktestbrowser/BrowserWindow.qml b/tests/quicktestbrowser/BrowserWindow.qml
index cb7de84dc..9e9f73646 100644
--- a/tests/quicktestbrowser/BrowserWindow.qml
+++ b/tests/quicktestbrowser/BrowserWindow.qml
@@ -54,12 +54,16 @@ ApplicationWindow {
id: browserWindow
property QtObject applicationRoot
property Item currentWebView: tabs.currentIndex < tabs.count ? tabs.getTab(tabs.currentIndex).item.webView : null
+ property int previousVisibility: Window.Windowed
property bool isFullScreen: visibility == Window.FullScreen
onIsFullScreenChanged: {
// This is for the case where the system forces us to leave fullscreen.
- if (currentWebView)
- currentWebView.state = isFullScreen ? "FullScreen" : ""
+ if (currentWebView && !isFullScreen) {
+ currentWebView.state = ""
+ if (currentWebView.isFullScreen)
+ currentWebView.fullScreenCancelled()
+ }
}
height: 600
@@ -89,7 +93,7 @@ ApplicationWindow {
offTheRecord: true
}
- // Make sure the Qt.WindowFullscreenButtonHint is set on Mac.
+ // Make sure the Qt.WindowFullscreenButtonHint is set on OS X.
Component.onCompleted: flags = flags | Qt.WindowFullscreenButtonHint
// Create a styleItem to determine the platform.
@@ -141,7 +145,7 @@ ApplicationWindow {
shortcut: "Escape"
onTriggered: {
if (browserWindow.isFullScreen)
- browserWindow.showNormal()
+ browserWindow.visibility = browserWindow.previousVisibility
}
}
Action {
@@ -380,18 +384,19 @@ ApplicationWindow {
}
}
- experimental {
- isFullScreen: webEngineView.state == "FullScreen" && browserWindow.isFullScreen
- onFullScreenRequested: {
- if (fullScreen) {
- webEngineView.state = "FullScreen"
- browserWindow.showFullScreen();
- } else {
- webEngineView.state = ""
- browserWindow.showNormal();
- }
+ onFullScreenRequested: {
+ if (request.toggleOn) {
+ webEngineView.state = "FullScreen"
+ browserWindow.previousVisibility = browserWindow.visibility
+ browserWindow.showFullScreen()
+ } else {
+ webEngineView.state = ""
+ browserWindow.visibility = browserWindow.previousVisibility
}
+ request.accept()
+ }
+ experimental {
onFeaturePermissionRequested: {
permBar.securityOrigin = securityOrigin;
permBar.requestedFeature = feature;