[vlc-devel] [PATCH v2 05/16] qml: allow to explicitly disable video surface in the player

Pierre Lamot pierre at videolabs.io
Fri Aug 14 18:43:39 CEST 2020


---
 modules/gui/qt/player/qml/Player.qml | 13 ++++++++-----
 modules/gui/qt/player/qml/TopBar.qml |  2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt/player/qml/Player.qml b/modules/gui/qt/player/qml/Player.qml
index 2a112d356c..062ae64820 100644
--- a/modules/gui/qt/player/qml/Player.qml
+++ b/modules/gui/qt/player/qml/Player.qml
@@ -34,6 +34,8 @@ Widgets.NavigableFocusScope {
     //menu/overlay to dismiss
     property var _menu: undefined
 
+    property bool hasEmbededVideo: mainInterface.hasEmbededVideo
+
     function dismiss() {
         if (_menu)
             _menu.dismiss()
@@ -61,7 +63,7 @@ Widgets.NavigableFocusScope {
     }
 
     navigationCancel: function() {
-        if (mainInterface.hasEmbededVideo && controlBarView.state === "visible") {
+        if (rootPlayer.hasEmbededVideo && controlBarView.state === "visible") {
             toolbarAutoHide._setVisibleControlBar(false)
         } else {
             if (player.hasVideoOutput) {
@@ -151,7 +153,7 @@ Widgets.NavigableFocusScope {
                 spacing: VLCStyle.margin_small
 
 
-                visible: !mainInterface.hasEmbededVideo
+                visible: !rootPlayer.hasEmbededVideo
 
                 Item {
                     Layout.fillHeight: true
@@ -311,7 +313,7 @@ Widgets.NavigableFocusScope {
 
                         lockAutoHide: playlistpopup.state === "visible"
                             || !player.hasVideoOutput
-                            || !mainInterface.hasEmbededVideo
+                            || !rootPlayer.hasEmbededVideo
                             || controllerMouseArea.containsMouse
                         onAutoHideChanged: {
                             if (autoHide)
@@ -329,7 +331,7 @@ Widgets.NavigableFocusScope {
 
     //center image
     Rectangle {
-        visible: !mainInterface.hasEmbededVideo
+        visible: !rootPlayer.hasEmbededVideo
         focus: false
         color: VLCStyle.colors.bg
         anchors.fill: parent
@@ -360,7 +362,8 @@ Widgets.NavigableFocusScope {
         z: 0
 
         ctx: mainctx
-        visible: mainInterface.hasEmbededVideo
+        visible: rootPlayer.hasEmbededVideo
+        enabled: rootPlayer.hasEmbededVideo
         anchors.fill: parent
 
         property point mousePosition: Qt.point(0,0)
diff --git a/modules/gui/qt/player/qml/TopBar.qml b/modules/gui/qt/player/qml/TopBar.qml
index 37df6dcc6a..b5b5b121cc 100644
--- a/modules/gui/qt/player/qml/TopBar.qml
+++ b/modules/gui/qt/player/qml/TopBar.qml
@@ -31,7 +31,7 @@ Widgets.NavigableFocusScope{
     implicitHeight: topcontrolContent.implicitHeight
 
     property bool autoHide: player.hasVideoOutput
-                            && mainInterface.hasEmbededVideo
+                            && rootPlayer.hasEmbededVideo
                             && !topcontrollerMouseArea.containsMouse
                             && !lockAutoHide
 
-- 
2.25.1



More information about the vlc-devel mailing list