[vlc-commits] [Git][videolan/vlc][master] 4 commits: qml: fix M401 in VLCStyle.qml

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat May 13 10:16:56 UTC 2023



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


Commits:
58e071be by Fatih Uzunoglu at 2023-05-13T09:47:17+00:00
qml: fix M401 in VLCStyle.qml

- - - - -
2dc78889 by Fatih Uzunoglu at 2023-05-13T09:47:17+00:00
qml: remove unneeded property

- - - - -
19431d11 by Fatih Uzunoglu at 2023-05-13T09:47:17+00:00
qml: fix M401 in MainInterface.qml

- - - - -
4c625465 by Fatih Uzunoglu at 2023-05-13T09:47:17+00:00
qml: fix M401 in MainDisplay.qml

- - - - -


7 changed files:

- modules/gui/qt/maininterface/qml/MainDisplay.qml
- modules/gui/qt/maininterface/qml/MainInterface.qml
- modules/gui/qt/player/qml/controlbarcontrols/ControlButtonPopup.qml
- modules/gui/qt/playlist/qml/PlaylistDetachedWindow.qml
- modules/gui/qt/style/VLCStyle.qml
- modules/gui/qt/widgets/qml/CSDMouseStealer.qml
- modules/gui/qt/widgets/qml/CSDWindowButtonSet.qml


Changes:

=====================================
modules/gui/qt/maininterface/qml/MainDisplay.qml
=====================================
@@ -34,7 +34,7 @@ import "qrc:///util/Helpers.js" as Helpers
 import "qrc:///dialogs/" as DG
 
 FocusScope {
-    id: root
+    id: g_mainDisplay
 
     //name and properties of the tab to be initially loaded
     property var view: ({
@@ -54,10 +54,6 @@ FocusScope {
     property bool _showMiniPlayer: false
     property var _oldViewProperties: ({}) // saves last state of the views
 
-    // Aliases
-
-    property alias g_mainDisplay: root
-
     onViewChanged: {
         _oldViewProperties[view.name] = view.properties
         loadView()
@@ -68,7 +64,7 @@ FocusScope {
     }
 
     function loadView() {
-        var found = stackView.loadView(root.pageModel, root.view.name, root.view.properties)
+        var found = stackView.loadView(g_mainDisplay.pageModel, g_mainDisplay.view.name, g_mainDisplay.view.properties)
 
         var item = stackView.currentItem
 
@@ -106,7 +102,7 @@ FocusScope {
         sourcesBanner.selectedIndex = pageModel.filter(function (e) {
             return e.listed
         }).findIndex(function (e) {
-            return e.name === root.view.name
+            return e.name === g_mainDisplay.view.name
         })
 
         if (item.pageModel !== undefined)
@@ -190,7 +186,7 @@ FocusScope {
 
 
     function showPlayer() {
-        root._inhibitMiniPlayer = true
+        g_mainDisplay._inhibitMiniPlayer = true
         History.push(["player"])
     }
 
@@ -221,7 +217,7 @@ FocusScope {
         id: medialibId
         anchors.fill: parent
 
-        Navigation.parentItem: root
+        Navigation.parentItem: g_mainDisplay
 
         Rectangle {
             id: parentRectangle
@@ -269,12 +265,12 @@ FocusScope {
                     Layout.maximumHeight: height
                     Layout.fillWidth: true
 
-                    model: root.tabModel
+                    model: g_mainDisplay.tabModel
 
                     plListView: playlist
 
                     onItemClicked: {
-                        var name = root.tabModel.get(index).name
+                        var name = g_mainDisplay.tabModel.get(index).name
                         selectedIndex = index
                         if (_oldViewProperties[name] === undefined)
                             History.push(["mc", name])
@@ -304,7 +300,7 @@ FocusScope {
                             left: parent.left
                             bottom: parent.bottom
 
-                            bottomMargin: root.displayMargin
+                            bottomMargin: g_mainDisplay.displayMargin
 
                             right: (playlistColumn.visible && !VLCStyle.isScreenSmall)
                                    ? playlistColumn.left
@@ -347,12 +343,12 @@ FocusScope {
                         focus: false
 
                         implicitWidth: VLCStyle.isScreenSmall
-                                       ? root.width * 0.8
-                                       : Helpers.clamp(root.width / resizeHandle.widthFactor,
+                                       ? g_mainDisplay.width * 0.8
+                                       : Helpers.clamp(g_mainDisplay.width / resizeHandle.widthFactor,
                                                        playlist.minimumWidth,
-                                                       root.width / 2)
+                                                       g_mainDisplay.width / 2)
                         width: 0
-                        height: parent.height - root.displayMargin
+                        height: parent.height - g_mainDisplay.displayMargin
 
                         visible: false
 
@@ -408,7 +404,7 @@ FocusScope {
                             rightPadding: VLCStyle.applicationHorizontalMargin
 
                             bottomPadding: topPadding + Math.max(VLCStyle.applicationVerticalMargin
-                                                                 - root.displayMargin, 0)
+                                                                 - g_mainDisplay.displayMargin, 0)
 
                             Navigation.parentItem: medialibId
                             Navigation.upItem: sourcesBanner
@@ -436,7 +432,7 @@ FocusScope {
 
                                 atRight: false
                                 targetWidth: playlistColumn.width
-                                sourceWidth: root.width
+                                sourceWidth: g_mainDisplay.width
 
                                 onWidthFactorChanged: {
                                     if (!_inhibitMainInterfaceUpdate)
@@ -500,17 +496,17 @@ FocusScope {
             width: VLCStyle.dp(320, VLCStyle.scale)
             height: VLCStyle.dp(180, VLCStyle.scale)
             z: 2
-            visible: !root._inhibitMiniPlayer && root._showMiniPlayer && MainCtx.hasEmbededVideo
-            enabled: !root._inhibitMiniPlayer && root._showMiniPlayer && MainCtx.hasEmbededVideo
+            visible: !g_mainDisplay._inhibitMiniPlayer && g_mainDisplay._showMiniPlayer && MainCtx.hasEmbededVideo
+            enabled: !g_mainDisplay._inhibitMiniPlayer && g_mainDisplay._showMiniPlayer && MainCtx.hasEmbededVideo
 
             dragXMin: 0
-            dragXMax: root.width - playerPip.width
+            dragXMax: g_mainDisplay.width - playerPip.width
             dragYMin: sourcesBanner.y + sourcesBanner.height
             dragYMax: miniPlayer.y - playerPip.height
 
             //keep the player visible on resize
             Connections {
-                target: root
+                target: g_mainDisplay
                 onWidthChanged: {
                     if (playerPip.x > playerPip.dragXMax)
                         playerPip.x = playerPip.dragXMax
@@ -524,7 +520,7 @@ FocusScope {
 
         DG.Dialogs {
             z: 10
-            bgContent: root
+            bgContent: g_mainDisplay
 
             anchors {
                 bottom: miniPlayer.visible ? miniPlayer.top : parent.bottom
@@ -537,7 +533,7 @@ FocusScope {
             id: miniPlayer
 
             BindingCompat on state {
-                when: root._inhibitMiniPlayer && !miniPlayer.visible
+                when: g_mainDisplay._inhibitMiniPlayer && !miniPlayer.visible
                 value: ""
             }
 


=====================================
modules/gui/qt/maininterface/qml/MainInterface.qml
=====================================
@@ -30,23 +30,21 @@ import "qrc:///style/"
 import "qrc:///playlist/" as PL
 
 Item {
-    id: root
+    id: g_mainInterface
 
     property bool _interfaceReady: false
     property bool _playlistReady: false
 
-    property alias g_root: root
-
     BindingCompat {
-        target: VLCStyle.self
+        target: VLCStyle
         property: "appWidth"
-        value: root.width
+        value: g_mainInterface.width
     }
 
     BindingCompat {
-        target: VLCStyle.self
+        target: VLCStyle
         property: "appHeight"
-        value: root.height
+        value: g_mainInterface.height
     }
 
     Window.onWindowChanged: {
@@ -91,8 +89,8 @@ Item {
         playlistPtr: MainCtx.mainPlaylist
 
         onPlaylistInitialized: {
-            root._playlistReady = true
-            if (root._interfaceReady)
+            g_mainInterface._playlistReady = true
+            if (g_mainInterface._interfaceReady)
                 setInitialView()
         }
     }
@@ -108,7 +106,7 @@ Item {
             console.warn("unable to load requested view, undefined")
             return
         }
-        stackView.loadView(root.pageModel, current.name, current.properties)
+        stackView.loadView(g_mainInterface.pageModel, current.name, current.properties)
     }
 
     Connections {
@@ -131,8 +129,8 @@ Item {
 
 
     Component.onCompleted: {
-        root._interfaceReady = true;
-        if (root._playlistReady)
+        g_mainInterface._interfaceReady = true;
+        if (g_mainInterface._playlistReady)
             setInitialView()
     }
 


=====================================
modules/gui/qt/player/qml/controlbarcontrols/ControlButtonPopup.qml
=====================================
@@ -102,7 +102,7 @@ Widgets.IconControlButton {
     Popup {
         id: popup
 
-        parent: (root._isCurrentViewPlayer) ? rootPlayer : g_root
+        parent: (root._isCurrentViewPlayer) ? rootPlayer : g_mainInterface
 
         padding: VLCStyle.margin_small
 


=====================================
modules/gui/qt/playlist/qml/PlaylistDetachedWindow.qml
=====================================
@@ -62,7 +62,5 @@ Window {
         anchors.fill: parent
 
         colorContext.palette: VLCStyle.palette
-
-        readonly property PlaylistListView g_root: playlistView
     }
 }


=====================================
modules/gui/qt/style/VLCStyle.qml
=====================================
@@ -33,8 +33,6 @@ QtObject {
     readonly property FontMetrics fontMetrics_xxlarge  : FontMetrics { font.pixelSize: dp(20, scale); }
     readonly property FontMetrics fontMetrics_xxxlarge : FontMetrics { font.pixelSize: dp(24, scale); }
 
-    property alias self: vlc_style
-
     readonly property SystemPalette palette:  SystemPalette {
         objectName: "themePalette"
         source: MainCtx.colorScheme.scheme


=====================================
modules/gui/qt/widgets/qml/CSDMouseStealer.qml
=====================================
@@ -27,8 +27,8 @@ Item {
     property int csdSize: MainCtx.csdBorderSize
 
     //private
-    readonly property int _edgeVtHeight: g_root.height - root.csdSize * 2
-    readonly property int _edgeHzWidth: g_root.width - root.csdSize * 2
+    readonly property int _edgeVtHeight: g_mainInterface.height - root.csdSize * 2
+    readonly property int _edgeHzWidth: g_mainInterface.width - root.csdSize * 2
 
     Repeater {
         model: [
@@ -51,7 +51,7 @@ Item {
             },
             {
                 edge: Qt.RightEdge,
-                x: g_root.width - root.csdSize,
+                x: g_mainInterface.width - root.csdSize,
                 y: root.csdSize,
                 width: root.csdSize,
                 height: root._edgeVtHeight,
@@ -60,7 +60,7 @@ Item {
             {
                 edge: Qt.BottomEdge,
                 x: root.csdSize,
-                y: g_root.height - root.csdSize,
+                y: g_mainInterface.height - root.csdSize,
                 width: root._edgeHzWidth,
                 height: root.csdSize,
                 cursor: Qt.SizeVerCursor,
@@ -77,14 +77,14 @@ Item {
             {
                 edge: Qt.BottomEdge | Qt.LeftEdge,
                 x: 0,
-                y: g_root.height - root.csdSize,
+                y: g_mainInterface.height - root.csdSize,
                 width: root.csdSize,
                 height: root.csdSize,
                 cursor: Qt.SizeBDiagCursor,
             },
             {
                 edge: Qt.TopEdge | Qt.RightEdge,
-                x: g_root.width - root.csdSize,
+                x: g_mainInterface.width - root.csdSize,
                 y: 0,
                 width: root.csdSize,
                 height: root.csdSize,
@@ -92,8 +92,8 @@ Item {
             },
             {
                 edge: Qt.BottomEdge | Qt.RightEdge,
-                x: g_root.width - root.csdSize,
-                y: g_root.height - root.csdSize,
+                x: g_mainInterface.width - root.csdSize,
+                y: g_mainInterface.height - root.csdSize,
                 width: root.csdSize,
                 height: root.csdSize,
                 cursor: Qt.SizeFDiagCursor,


=====================================
modules/gui/qt/widgets/qml/CSDWindowButtonSet.qml
=====================================
@@ -90,7 +90,7 @@ Row {
             onHeightChanged: Qt.callLater(updateRect)
 
             Connections {
-                target: VLCStyle.self
+                target: VLCStyle
 
                 // handle window resize
                 onAppWidthChanged: Qt.callLater(updateRect)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9d6c7e1cd1eea35ec33e44838d53f0db4054d10c...4c62546566f0d481d76977f48eaa219e71ad5d6d

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9d6c7e1cd1eea35ec33e44838d53f0db4054d10c...4c62546566f0d481d76977f48eaa219e71ad5d6d
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