[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: do not use property to represent signals

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Fri Dec 8 08:55:12 UTC 2023



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


Commits:
b84994a7 by Fatih Uzunoglu at 2023-12-08T08:28:01+00:00
qml: do not use property to represent signals

- - - - -
3d1addbf by Fatih Uzunoglu at 2023-12-08T08:28:01+00:00
qml: forward spacing in ControlLayout

- - - - -


3 changed files:

- modules/gui/qt/player/qml/ControlLayout.qml
- modules/gui/qt/player/qml/ControlRepeater.qml
- modules/gui/qt/player/qml/PlayerControlLayout.qml


Changes:

=====================================
modules/gui/qt/player/qml/ControlLayout.qml
=====================================
@@ -95,6 +95,8 @@ FocusScope {
 
     property alias model: repeater.model
 
+    property alias spacing: rowLayout.spacing
+
     // Signals
 
     signal requestLockUnlockAutoHide(bool lock)
@@ -143,8 +145,6 @@ FocusScope {
 
         anchors.fill: parent
 
-        spacing: playerControlLayout.spacing
-
         Item {
             Layout.fillWidth: visible
             visible: (controlLayout.alignment & Qt.AlignRight)
@@ -158,8 +158,10 @@ FocusScope {
             availableWidth: rowLayout.width
             availableHeight: rowLayout.height
 
-            requestLockUnlockAutoHide: controlLayout.requestLockUnlockAutoHide
-            menuOpened: controlLayout.menuOpened
+            Component.onCompleted: {
+                requestLockUnlockAutoHide.connect(controlLayout.requestLockUnlockAutoHide)
+                menuOpened.connect(controlLayout.menuOpened)
+            }
         }
 
         Item {


=====================================
modules/gui/qt/player/qml/ControlRepeater.qml
=====================================
@@ -30,8 +30,8 @@ Repeater {
     property real availableWidth: Number.MAX_VALUE
     property real availableHeight: Number.MAX_VALUE
 
-    property var menuOpened
-    property var requestLockUnlockAutoHide
+    signal requestLockUnlockAutoHide(bool lock)
+    signal menuOpened(var menu)
 
     // NOTE: We apply the 'navigation chain' after adding the item.
     onItemAdded: item.applyNavigation()


=====================================
modules/gui/qt/player/qml/PlayerControlLayout.qml
=====================================
@@ -110,6 +110,11 @@ FocusScope {
 
                 availableWidth: loaderLeftRight.width
                 availableHeight: loaderLeftRight.height
+
+                Component.onCompleted: {
+                    requestLockUnlockAutoHide.connect(playerControlLayout.requestLockUnlockAutoHide)
+                    menuOpened.connect(playerControlLayout.menuOpened)
+                }
             }
 
             Item {
@@ -151,6 +156,11 @@ FocusScope {
 
                 availableWidth: loaderLeftRight.width
                 availableHeight: loaderLeftRight.height
+
+                Component.onCompleted: {
+                    requestLockUnlockAutoHide.connect(playerControlLayout.requestLockUnlockAutoHide)
+                    menuOpened.connect(playerControlLayout.menuOpened)
+                }
             }
         }
     }
@@ -184,6 +194,8 @@ FocusScope {
 
             alignment: (Qt.AlignVCenter | Qt.AlignLeft)
 
+            spacing: playerControlLayout.spacing
+
             focus: true
 
             altFocusAction: Navigation.defaultNavigationRight
@@ -191,9 +203,10 @@ FocusScope {
             Navigation.parentItem: playerControlLayout
             Navigation.rightItem: loaderCenter.item
 
-            onRequestLockUnlockAutoHide: playerControlLayout.requestLockUnlockAutoHide(lock)
-
-            onMenuOpened: playerControlLayout.menuOpened(menu)
+            Component.onCompleted: {
+                requestLockUnlockAutoHide.connect(playerControlLayout.requestLockUnlockAutoHide)
+                menuOpened.connect(playerControlLayout.menuOpened)
+            }
         }
     }
 
@@ -242,15 +255,18 @@ FocusScope {
 
             focus: true
 
+            spacing: playerControlLayout.spacing
+
             altFocusAction: Navigation.defaultNavigationUp
 
             Navigation.parentItem: playerControlLayout
             Navigation.leftItem: loaderLeft.item
             Navigation.rightItem: loaderRight.item
 
-            onRequestLockUnlockAutoHide: playerControlLayout.requestLockUnlockAutoHide(lock)
-
-            onMenuOpened: playerControlLayout.menuOpened(menu)
+            Component.onCompleted: {
+                requestLockUnlockAutoHide.connect(playerControlLayout.requestLockUnlockAutoHide)
+                menuOpened.connect(playerControlLayout.menuOpened)
+            }
         }
     }
 
@@ -280,6 +296,8 @@ FocusScope {
 
             alignment: (Qt.AlignVCenter | Qt.AlignRight)
 
+            spacing: playerControlLayout.spacing
+
             focus: true
 
             altFocusAction: Navigation.defaultNavigationLeft



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a5c39d7647b35f0b81e36bf45ae0f1c162215bad...3d1addbfefdab83ed4e8a7db7e7c54966e5fcaf5

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a5c39d7647b35f0b81e36bf45ae0f1c162215bad...3d1addbfefdab83ed4e8a7db7e7c54966e5fcaf5
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