summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@theqtcompany.com>2015-11-05 21:19:23 +0100
committerMichal Klocek <michal.klocek@theqtcompany.com>2015-11-17 15:42:00 +0000
commit2e18b419a7084b1e39bf8749855768a1002e34de (patch)
treeb88acc8a61dfd04c85c18856a724f8c566274fad /src
parent8a1e95239518d3c4344122f66ad66a49d455e4dc (diff)
Add fullscreen video support
Change-Id: I5214a1cad6f460d2d92c5c3ea04ee948305b1312 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/BrowserWindow.qml16
-rw-r--r--src/qml/PageView.qml17
-rw-r--r--src/src.pro3
3 files changed, 35 insertions, 1 deletions
diff --git a/src/qml/BrowserWindow.qml b/src/qml/BrowserWindow.qml
index c95ee53..8b112cd 100644
--- a/src/qml/BrowserWindow.qml
+++ b/src/qml/BrowserWindow.qml
@@ -167,6 +167,22 @@ Item {
}
}
+ UIToolBar {
+ id: fullScreenBar
+ z: 6
+ title: qsTr("Leave Full Screen Mode")
+ visible: opacity != 0.0
+ opacity: tabView.viewState == "fullscreen" ? 1.0 : 0.0
+ anchors {
+ left: parent.left
+ right: parent.right
+ top: navigation.top
+ }
+ onDoneClicked: {
+ navigation.webView.triggerWebAction(WebEngineView.ExitFullScreen);
+ }
+ }
+
NavigationBar {
id: navigation
diff --git a/src/qml/PageView.qml b/src/qml/PageView.qml
index e82b759..d9bcaab 100644
--- a/src/qml/PageView.qml
+++ b/src/qml/PageView.qml
@@ -59,7 +59,7 @@ Rectangle {
property string viewState: "page"
onViewStateChanged: {
- if (viewState == "page")
+ if (viewState == "page" || viewState == "fullscreen")
homeScreen.state = "disabled"
}
@@ -197,6 +197,14 @@ Rectangle {
permBar.requestedFeature = feature;
permBar.visible = true;
}
+
+ onFullScreenRequested: {
+ if (request.toggleOn)
+ viewState = "fullscreen"
+ else
+ viewState = "page"
+ request.accept()
+ }
}
Desaturate {
@@ -456,6 +464,13 @@ Rectangle {
PropertyChanges { target: wrapper; width: itemWidth; height: itemHeight; visibility: 1.0 }
PropertyChanges { target: pathView; interactive: true }
PropertyChanges { target: item; opacity: 0.0 }
+ },
+ State {
+ name: "fullscreen"
+ PropertyChanges { target: wrapper; width: root.width; height: root.height; visibility: 0.0 }
+ PropertyChanges { target: pathView; interactive: false }
+ PropertyChanges { target: item; opacity: 1.0 }
+ PropertyChanges { target: navigation; state: "disabled" }
}
]
diff --git a/src/src.pro b/src/src.pro
index d083e80..e30748a 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -36,3 +36,6 @@ QT_PRIVATE += quick-private gui-private core-private
RESOURCES += resources.qrc
!cross_compile: DEFINES += HOST_BUILD
+
+target.path = /data/user/qt/qtwebbrowser
+INSTALLS += target