[vlc-commits] qml: remove autoHide from TopBar

Prince Gupta git at videolan.org
Mon Mar 15 10:32:58 UTC 2021


vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Mon Feb  8 19:36:35 2021 +0530| [1de41eb7d687901994e36692cef3dd3125172382] | committer: Pierre Lamot

qml: remove autoHide from TopBar

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1de41eb7d687901994e36692cef3dd3125172382
---

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

diff --git a/modules/gui/qt/player/qml/Player.qml b/modules/gui/qt/player/qml/Player.qml
index e420e2a6b3..ac8862191b 100644
--- a/modules/gui/qt/player/qml/Player.qml
+++ b/modules/gui/qt/player/qml/Player.qml
@@ -37,6 +37,7 @@ Widgets.NavigableFocusScope {
     readonly property bool _autoHide: _lockAutoHide == 0
                                       && rootPlayer.hasEmbededVideo
                                       && player.hasVideoOutput
+                                      && playlistpopup.state !== "visible"
 
     property bool hasEmbededVideo: mainInterface.hasEmbededVideo
     readonly property int positionSliderY: controlBarView.y + controlBarView.sliderY
@@ -259,7 +260,6 @@ Widgets.NavigableFocusScope {
 
         z: 1
         edge: Widgets.DrawerExt.Edges.Top
-        property var autoHide: topcontrolView.contentItem.autoHide
 
         state: "visible"
 
@@ -267,7 +267,6 @@ Widgets.NavigableFocusScope {
             width: topcontrolView.width
             height: topbar.implicitHeight
             focus: true
-            property bool autoHide: topbar.autoHide && !resumeDialog.visible
 
             TopBar {
                 id: topbar
@@ -276,13 +275,6 @@ Widgets.NavigableFocusScope {
 
                 focus: true
                 visible: !resumeDialog.visible
-
-                onAutoHideChanged: {
-                    if (autoHide)
-                        toolbarAutoHide.restart()
-                }
-
-                lockAutoHide: playlistpopup.state === "visible"
                 title: mainPlaylistController.currentItem.title
                 colors: rootPlayer.colors
 
@@ -295,6 +287,10 @@ Widgets.NavigableFocusScope {
                     else
                         mainInterface.playlistVisible = !mainInterface.playlistVisible
                 }
+
+                onRequestLockUnlockAutoHide: {
+                    rootPlayer.lockUnlockAutoHide(lock, source)
+                }
             }
 
             ResumeDialog {
@@ -310,6 +306,10 @@ Widgets.NavigableFocusScope {
                         controlBarView.forceActiveFocus()
                     }
                 }
+
+                onVisibleChanged: {
+                    rootPlayer.lockUnlockAutoHide(visible, resumeDialog)
+                }
             }
         }
     }
@@ -549,7 +549,7 @@ Widgets.NavigableFocusScope {
             {
                 if (!rootPlayer._autoHide)
                     return;
-                if (!controlBarView.autoHide || !topcontrolView.autoHide)
+                if (!controlBarView.autoHide)
                     return;
                 controlBarView.state = "hidden"
                 topcontrolView.state = "hidden"
diff --git a/modules/gui/qt/player/qml/TopBar.qml b/modules/gui/qt/player/qml/TopBar.qml
index 39a05c3e6d..5370e8f61f 100644
--- a/modules/gui/qt/player/qml/TopBar.qml
+++ b/modules/gui/qt/player/qml/TopBar.qml
@@ -31,17 +31,11 @@ Widgets.NavigableFocusScope{
 
     implicitHeight: topcontrolContent.implicitHeight
 
-    property bool autoHide: player.hasVideoOutput
-                            && rootPlayer.hasEmbededVideo
-                            && !topcontrollerMouseArea.containsMouse
-                            && !lockAutoHide
-
-    property bool lockAutoHide: false
-
     property alias title: titleText.text
     property VLCColors colors: VLCStyle.nightColors
 
     signal tooglePlaylistVisibility()
+    signal requestLockUnlockAutoHide(bool lock, var source)
 
     function forceFocusOnPlaylistButton() {
         playlistButton.forceActiveFocus()
@@ -65,6 +59,8 @@ Widgets.NavigableFocusScope{
             anchors.rightMargin: VLCStyle.applicationHorizontalMargin
             implicitHeight: rowLayout.implicitHeight
 
+            onContainsMouseChanged: topFocusScope.requestLockUnlockAutoHide(containsMouse, topFocusScope)
+
             //drag and dbl click the titlebar in CSD mode
             Loader {
                 anchors.fill: parent



More information about the vlc-commits mailing list