summaryrefslogtreecommitdiffstats
path: root/examples/webengine
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@theqtcompany.com>2015-11-05 21:07:26 +0100
committerMichal Klocek <michal.klocek@theqtcompany.com>2015-12-17 14:18:10 +0000
commit1c547c6a4cafee9b26672c1fbb26b26036b62f4a (patch)
tree0a6261b2d58a1904056b9fa131efe060ee7096b8 /examples/webengine
parentdadf364df20391e74f1b02d4f0b0e418ae299e6f (diff)
Fix fullscreen mode in qml api
Current implementation was not working correctly for quicknanobrowser when entering and leaving fullscreen video, in cases where the browser itself was already fullscreen. Use ExitFullScreen to leave fullscreen in demo code. Use onFullScreenRequested handler to track if fullscreen mode is on. Change-Id: I022d5e830b189897d34a9a8747381d041101c692 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'examples/webengine')
-rw-r--r--examples/webengine/quicknanobrowser/BrowserWindow.qml17
1 files changed, 4 insertions, 13 deletions
diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml
index e8a9cb9ce..3b276a4a9 100644
--- a/examples/webengine/quicknanobrowser/BrowserWindow.qml
+++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml
@@ -54,18 +54,6 @@ ApplicationWindow {
property Item currentWebView: tabs.currentIndex < tabs.count ? tabs.getTab(tabs.currentIndex).item : 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 && !isFullScreen) {
- currentWebView.state = ""
- if (currentWebView.isFullScreen) {
- currentWebView.fullScreenCancelled()
- fullScreenNotification.hide()
- }
- }
- }
-
width: 1300
height: 900
visible: true
@@ -127,8 +115,11 @@ ApplicationWindow {
Action {
shortcut: "Escape"
onTriggered: {
- if (browserWindow.isFullScreen)
+ if (currentWebView.state == "FullScreen") {
browserWindow.visibility = browserWindow.previousVisibility
+ fullScreenNotification.hide()
+ currentWebView.triggerWebAction(WebEngineView.ExitFullScreen);
+ }
}
}
Action {