[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: remove unused parameter in lockPlayer signal

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Thu Jul 14 10:02:50 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
ef86305e by Pierre Lamot at 2022-07-14T09:47:59+00:00
qml: remove unused parameter in lockPlayer signal

- - - - -
75b0d445 by Pierre Lamot at 2022-07-14T09:47:59+00:00
qml: propagate the lock player signal in player widgets

instead of violating the scope of widgets

- - - - -


10 changed files:

- modules/gui/qt/player/qml/ControlBar.qml
- modules/gui/qt/player/qml/ControlLayout.qml
- modules/gui/qt/player/qml/Player.qml
- modules/gui/qt/player/qml/PlayerControlLayout.qml
- modules/gui/qt/player/qml/TopBar.qml
- modules/gui/qt/player/qml/controlbarcontrols/BookmarkButton.qml
- modules/gui/qt/player/qml/controlbarcontrols/LangButton.qml
- modules/gui/qt/player/qml/controlbarcontrols/MenuButton.qml
- modules/gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml
- modules/gui/qt/player/qml/controlbarcontrols/RendererButton.qml


Changes:

=====================================
modules/gui/qt/player/qml/ControlBar.qml
=====================================
@@ -46,7 +46,7 @@ Control {
     property alias sliderBackgroundColor: trackPositionSlider.backgroundColor
     property bool showRightTimeText: true
 
-    signal requestLockUnlockAutoHide(bool lock, var source)
+    signal requestLockUnlockAutoHide(bool lock)
 
     function showChapterMarks() {
         trackPositionSlider.showChapterMarks()
@@ -143,7 +143,7 @@ Control {
 
             colors: root.colors
 
-            onRequestLockUnlockAutoHide: root.requestLockUnlockAutoHide(lock, source)
+            onRequestLockUnlockAutoHide: root.requestLockUnlockAutoHide(lock)
         }
     }
 


=====================================
modules/gui/qt/player/qml/ControlLayout.qml
=====================================
@@ -29,6 +29,8 @@ import "qrc:///widgets/" as Widgets
 FocusScope {
     id: controlLayout
 
+    signal requestLockUnlockAutoHide(bool lock)
+
     property alias model: repeater.model
 
     readonly property real minimumWidth: {
@@ -168,6 +170,12 @@ FocusScope {
                     item.width = Qt.binding(function() { return loader.width } )
 
                     item.visible = Qt.binding(function() { return loader.visible })
+
+                    if (item.requestLockUnlockAutoHide) {
+                        item.requestLockUnlockAutoHide.connect(function(lock) {
+                            controlLayout.requestLockUnlockAutoHide(lock)
+                        })
+                    }
                 }
 
                 function applyNavigation() {


=====================================
modules/gui/qt/player/qml/Player.qml
=====================================
@@ -98,7 +98,7 @@ FocusScope {
     }
 
     onPinVideoControlsChanged: {
-        lockUnlockAutoHide(pinVideoControls, "pinVideoControl")
+        lockUnlockAutoHide(pinVideoControls)
         if (pinVideoControls)
             toolbarAutoHide.setVisibleControlBar(true)
     }
@@ -112,7 +112,7 @@ FocusScope {
             menu.close()
     }
 
-    function lockUnlockAutoHide(lock, source /*unused*/) {
+    function lockUnlockAutoHide(lock) {
         _lockAutoHide += lock ? 1 : -1;
         console.assert(_lockAutoHide >= 0)
     }
@@ -132,12 +132,12 @@ FocusScope {
         id: playlistVisibility
 
         onShowPlaylist: {
-            rootPlayer.lockUnlockAutoHide(true, playlistVisibility)
+            rootPlayer.lockUnlockAutoHide(true)
             MainCtx.playlistVisible = true
         }
 
         onHidePlaylist: {
-            rootPlayer.lockUnlockAutoHide(false, playlistVisibility)
+            rootPlayer.lockUnlockAutoHide(false)
             MainCtx.playlistVisible = false
         }
     }
@@ -349,7 +349,7 @@ FocusScope {
                 onTogglePlaylistVisibility: playlistVisibility.togglePlaylistVisibility()
 
                 onRequestLockUnlockAutoHide: {
-                    rootPlayer.lockUnlockAutoHide(lock, source)
+                    rootPlayer.lockUnlockAutoHide(lock)
                 }
 
                 onBackRequested: {
@@ -375,7 +375,7 @@ FocusScope {
                 }
 
                 onVisibleChanged: {
-                    rootPlayer.lockUnlockAutoHide(visible, resumeDialog)
+                    rootPlayer.lockUnlockAutoHide(visible)
                 }
             }
         }
@@ -623,7 +623,7 @@ FocusScope {
                 controllerId.showChapterMarks()
             }
 
-            onContainsMouseChanged: rootPlayer.lockUnlockAutoHide(containsMouse, topcontrolView)
+            onContainsMouseChanged: rootPlayer.lockUnlockAutoHide(containsMouse)
 
             ControlBar {
                 id: controllerId
@@ -641,7 +641,7 @@ FocusScope {
                 Navigation.parentItem: rootPlayer
                 Navigation.upItem: playlistpopup.showPlaylist ? playlistpopup : (audioControls.visible ? audioControls : topcontrolView)
 
-                onRequestLockUnlockAutoHide: rootPlayer.lockUnlockAutoHide(lock, source)
+                onRequestLockUnlockAutoHide: rootPlayer.lockUnlockAutoHide(lock)
 
                 identifier: (Player.hasVideoOutput) ? PlayerControlbarModel.Videoplayer
                                                     : PlayerControlbarModel.Audioplayer


=====================================
modules/gui/qt/player/qml/PlayerControlLayout.qml
=====================================
@@ -44,7 +44,7 @@ FocusScope {
             null
     }
 
-    signal requestLockUnlockAutoHide(bool lock, var source)
+    signal requestLockUnlockAutoHide(bool lock)
 
     Component.onCompleted: {
         console.assert(identifier >= 0)
@@ -81,6 +81,8 @@ FocusScope {
             focus: true
 
             altFocusAction: Navigation.defaultNavigationRight
+
+            onRequestLockUnlockAutoHide: playerControlLayout.requestLockUnlockAutoHide(lock)
         }
     }
 
@@ -113,6 +115,8 @@ FocusScope {
             focus: true
 
             altFocusAction: Navigation.defaultNavigationUp
+
+            onRequestLockUnlockAutoHide: playerControlLayout.requestLockUnlockAutoHide(lock)
         }
     }
 
@@ -147,6 +151,8 @@ FocusScope {
             focus: true
 
             altFocusAction: Navigation.defaultNavigationLeft
+
+            onRequestLockUnlockAutoHide: playerControlLayout.requestLockUnlockAutoHide(lock)
         }
     }
 }


=====================================
modules/gui/qt/player/qml/TopBar.qml
=====================================
@@ -43,7 +43,7 @@ FocusScope{
     property int reservedHeight: 0
 
     signal togglePlaylistVisibility()
-    signal requestLockUnlockAutoHide(bool lock, var source)
+    signal requestLockUnlockAutoHide(bool lock)
     signal backRequested()
 
     Component.onCompleted:  root._layout()
@@ -172,8 +172,8 @@ FocusScope{
         highlightedBgColor: root.colors.bgHover
         highlightedTextColor: root.colors.bgHoverText
 
-        onHoveredChanged: root.requestLockUnlockAutoHide(hovered, root)
-        onMenuOpenedChanged: root.requestLockUnlockAutoHide(menuOpened, root)
+        onHoveredChanged: root.requestLockUnlockAutoHide(hovered)
+        onMenuOpenedChanged: root.requestLockUnlockAutoHide(menuOpened)
     }
 
     RowLayout {
@@ -201,7 +201,7 @@ FocusScope{
             Navigation.rightItem: menuSelector
             onClicked: root.backRequested()
 
-            onHoveredChanged: root.requestLockUnlockAutoHide(hovered, root)
+            onHoveredChanged: root.requestLockUnlockAutoHide(hovered)
         }
 
         Image {
@@ -297,7 +297,7 @@ FocusScope{
         Connections {
             target: csdDecorations.item
             enabled: csdDecorations.loaded
-            onHoveredChanged: root.requestLockUnlockAutoHide(csdDecorations.item.hovered, root)
+            onHoveredChanged: root.requestLockUnlockAutoHide(csdDecorations.item.hovered)
         }
     }
 
@@ -332,15 +332,15 @@ FocusScope{
 
             onClicked: contextMenu.popup(this.mapToGlobal(0, height))
 
-            onHoveredChanged: root.requestLockUnlockAutoHide(hovered, root)
+            onHoveredChanged: root.requestLockUnlockAutoHide(hovered)
 
             QmlGlobalMenu {
                 id: contextMenu
 
                 ctx: MainCtx
 
-                onAboutToShow: root.requestLockUnlockAutoHide(true, contextMenu)
-                onAboutToHide: root.requestLockUnlockAutoHide(false, contextMenu)
+                onAboutToShow: root.requestLockUnlockAutoHide(true)
+                onAboutToHide: root.requestLockUnlockAutoHide(false)
             }
         }
 
@@ -361,7 +361,7 @@ FocusScope{
             Navigation.leftItem: menuSelector.visible ? menuSelector : backBtn
             onClicked: togglePlaylistVisibility()
 
-            onHoveredChanged: root.requestLockUnlockAutoHide(hovered, root)
+            onHoveredChanged: root.requestLockUnlockAutoHide(hovered)
         }
     }
 }


=====================================
modules/gui/qt/player/qml/controlbarcontrols/BookmarkButton.qml
=====================================
@@ -26,6 +26,10 @@ import "qrc:///widgets/" as Widgets
 import "qrc:///style/"
 
 Widgets.IconControlButton {
+    id: root
+
+    signal requestLockUnlockAutoHide(bool lock)
+
     size: VLCStyle.icon_medium
 
     iconText: VLCIcons.bookmark
@@ -41,7 +45,7 @@ Widgets.IconControlButton {
 
         player: Player
 
-        onAboutToShow: playerControlLayout.requestLockUnlockAutoHide(true, menu)
-        onAboutToHide: playerControlLayout.requestLockUnlockAutoHide(false, menu)
+        onAboutToShow: root.requestLockUnlockAutoHide(true)
+        onAboutToHide: root.requestLockUnlockAutoHide(false)
     }
 }


=====================================
modules/gui/qt/player/qml/controlbarcontrols/LangButton.qml
=====================================
@@ -32,6 +32,8 @@ Widgets.IconControlButton {
     enabled: menuLoader.status === Loader.Ready
     onClicked: menuLoader.item.open()
 
+    signal requestLockUnlockAutoHide(bool lock)
+
     text: I18n.qtr("Languages and tracks")
 
     Loader {
@@ -49,13 +51,13 @@ Widgets.IconControlButton {
             z: 1
 
             onOpened: {
-                playerControlLayout.requestLockUnlockAutoHide(true, playerControlLayout)
+                langBtn.requestLockUnlockAutoHide(true)
                 if (!!rootPlayer)
                     rootPlayer.menu = menu
             }
 
             onClosed: {
-                playerControlLayout.requestLockUnlockAutoHide(false, playerControlLayout)
+                langBtn.requestLockUnlockAutoHide(false)
                 langBtn.forceActiveFocus()
                 if (!!rootPlayer)
                     rootPlayer.menu = undefined


=====================================
modules/gui/qt/player/qml/controlbarcontrols/MenuButton.qml
=====================================
@@ -25,6 +25,9 @@ import "qrc:///style/"
 
 Widgets.IconControlButton {
     id: menuBtn
+
+    signal requestLockUnlockAutoHide(bool lock)
+
     size: VLCStyle.icon_medium
     iconText: VLCIcons.ellipsis
     text: I18n.qtr("Menu")
@@ -36,7 +39,7 @@ Widgets.IconControlButton {
 
         ctx: MainCtx
 
-        onAboutToShow: playerControlLayout.requestLockUnlockAutoHide(true, contextMenu)
-        onAboutToHide: playerControlLayout.requestLockUnlockAutoHide(false, contextMenu)
+        onAboutToShow: menuBtn.requestLockUnlockAutoHide(true)
+        onAboutToHide: menuBtn.requestLockUnlockAutoHide(false)
     }
 }


=====================================
modules/gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml
=====================================
@@ -30,6 +30,8 @@ import "qrc:///util/Helpers.js" as Helpers
 Widgets.IconControlButton {
     id: root
 
+    signal requestLockUnlockAutoHide(bool lock)
+
     readonly property bool _isCurrentViewPlayer: !paintOnly && (History.current.name === "player")
 
     size: VLCStyle.icon_medium
@@ -89,14 +91,14 @@ Widgets.IconControlButton {
             })
 
             // player related --
-            playerControlLayout.requestLockUnlockAutoHide(true, playerControlLayout)
+            root.requestLockUnlockAutoHide(true)
 
             if (root._isCurrentViewPlayer)
                 rootPlayer.menu = popup
         }
 
         onClosed: {
-            playerControlLayout.requestLockUnlockAutoHide(false, playerControlLayout)
+            root.requestLockUnlockAutoHide(false)
 
             root.forceActiveFocus()
 


=====================================
modules/gui/qt/player/qml/controlbarcontrols/RendererButton.qml
=====================================
@@ -26,6 +26,10 @@ import "qrc:///widgets/" as Widgets
 import "qrc:///style/"
 
 Widgets.IconControlButton {
+    id: root
+
+    signal requestLockUnlockAutoHide(bool lock)
+
     size: VLCStyle.icon_medium
 
     iconText: VLCIcons.renderer
@@ -39,7 +43,7 @@ Widgets.IconControlButton {
 
         ctx: MainCtx
 
-        onAboutToShow: playerControlLayout.requestLockUnlockAutoHide(true, menu)
-        onAboutToHide: playerControlLayout.requestLockUnlockAutoHide(false, menu)
+        onAboutToShow: root.requestLockUnlockAutoHide(true)
+        onAboutToHide: root.requestLockUnlockAutoHide(false)
     }
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/22c02e96ea46003c2df529ac042392ee31a2204e...75b0d4458d5e2185d0df93ffee7fc708704a0dc5

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/22c02e96ea46003c2df529ac042392ee31a2204e...75b0d4458d5e2185d0df93ffee7fc708704a0dc5
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list