[vlc-commits] qml: remove negation in Player's boolean variable names

Pierre Lamot git at videolan.org
Thu Feb 20 13:56:46 CET 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Tue Feb 18 17:09:55 2020 +0100| [260a099cd55b123fe13db46670c5b979017cc148] | committer: Jean-Baptiste Kempf

qml: remove negation in Player's boolean variable names

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt/player/qml/ControlBar.qml |  3 ++-
 modules/gui/qt/player/qml/Player.qml     | 23 +++++++++++++----------
 modules/gui/qt/player/qml/TopBar.qml     | 10 ++++++----
 3 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/modules/gui/qt/player/qml/ControlBar.qml b/modules/gui/qt/player/qml/ControlBar.qml
index 7460d31e56..9c5ea06e73 100644
--- a/modules/gui/qt/player/qml/ControlBar.qml
+++ b/modules/gui/qt/player/qml/ControlBar.qml
@@ -34,7 +34,8 @@ Widgets.NavigableFocusScope {
 
     signal showTrackBar()
 
-    property bool noAutoHide: _lockAutoHide !== 0
+    property bool autoHide: _lockAutoHide === 0 && !lockAutoHide
+    property bool lockAutoHide: false
     property int  _lockAutoHide: 0 //count the number of element locking the autoHide
 
     Keys.priority: Keys.AfterItem
diff --git a/modules/gui/qt/player/qml/Player.qml b/modules/gui/qt/player/qml/Player.qml
index e0485f7f26..b23359029c 100644
--- a/modules/gui/qt/player/qml/Player.qml
+++ b/modules/gui/qt/player/qml/Player.qml
@@ -175,18 +175,18 @@ Widgets.NavigableFocusScope {
             top: parent.top
         }
         edge: Widgets.DrawerExt.Edges.Top
-        property var noAutoHide: topcontrolView.contentItem.noAutoHide
+        property var autoHide: topcontrolView.contentItem.autoHide
 
         state: "visible"
 
         component: TopBar{
             focus: true
             width: topcontrolView.width
-            noAutoHide: noAutoHideInt ||  playlistpopup.state === "visible"
-            onNoAutoHideChanged: {
-                if (!noAutoHide)
+            onAutoHideChanged: {
+                if (autoHide)
                     toolbarAutoHide.restart()
             }
+            lockAutoHide: playlistpopup.state === "visible"
 
             onTogglePlaylistVisiblity:  {
                 if (rootWindow.playlistDocked)
@@ -251,7 +251,7 @@ Widgets.NavigableFocusScope {
             right: parent.right
             bottom: parent.bottom
         }
-        property var  noAutoHide: controlBarView.contentItem.noAutoHide
+        property var autoHide: controlBarView.contentItem.autoHide
 
         state: "visible"
         edge: Widgets.DrawerExt.Edges.Bottom
@@ -265,7 +265,7 @@ Widgets.NavigableFocusScope {
 
             width: controlBarView.width
             height: controllerId.implicitHeight + controllerId.anchors.bottomMargin
-            property alias noAutoHide: controllerId.noAutoHide
+            property alias autoHide: controllerId.autoHide
 
             MouseArea {
                 id: controllerMouseArea
@@ -280,9 +280,12 @@ Widgets.NavigableFocusScope {
                     anchors.rightMargin: VLCStyle.applicationHorizontalMargin
                     anchors.bottomMargin: VLCStyle.applicationVerticalMargin
 
-                    property bool disableAutoHide: playlistpopup.state === "visible" || !player.hasVideoOutput || !rootWindow.hasEmbededVideo || controllerMouseArea.containsMouse
-                    onNoAutoHideChanged: {
-                        if (!noAutoHide && disableAutoHide)
+                    lockAutoHide: playlistpopup.state === "visible"
+                        || !player.hasVideoOutput
+                        || !rootWindow.hasEmbededVideo
+                        || controllerMouseArea.containsMouse
+                    onAutoHideChanged: {
+                        if (autoHide)
                             toolbarAutoHide.restart()
                     }
 
@@ -314,7 +317,7 @@ Widgets.NavigableFocusScope {
             }
             else
             {
-                if (controlBarView.noAutoHide || topcontrolView.noAutoHide)
+                if (!controlBarView.autoHide || !topcontrolView.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 8eb154b009..6d6c9d7007 100644
--- a/modules/gui/qt/player/qml/TopBar.qml
+++ b/modules/gui/qt/player/qml/TopBar.qml
@@ -26,12 +26,14 @@ import "qrc:///widgets/" as Widgets
 
 Widgets.NavigableFocusScope{
     id: topFocusScope
+
     height: topcontrolContent.implicitHeight
-    property bool noAutoHide: false
 
-    property bool noAutoHideInt: !player.hasVideoOutput
-                              || !rootWindow.hasEmbededVideo
-                              || topcontrollerMouseArea.containsMouse || lockAutoHide
+    property bool autoHide: player.hasVideoOutput
+                            && rootWindow.hasEmbededVideo
+                            && !topcontrollerMouseArea.containsMouse
+                            && !lockAutoHide
+
     property bool lockAutoHide: false
 
     signal togglePlaylistVisiblity();



More information about the vlc-commits mailing list