[vlc-commits] [Git][videolan/vlc][master] 6 commits: qml: remove leftover usages of Helpers.get

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Apr 25 05:58:22 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
c7a30900 by Pierre Lamot at 2024-04-25T05:18:16+00:00
qml: remove leftover usages of Helpers.get

- - - - -
0b6be774 by Pierre Lamot at 2024-04-25T05:18:16+00:00
qml: currentItem may be null in VideoRecentVideos

- - - - -
cac89ca0 by Pierre Lamot at 2024-04-25T05:18:16+00:00
qml: add missing default value after nullish tests

- - - - -
d9c2fd38 by Pierre Lamot at 2024-04-25T05:18:16+00:00
qml: fix ambigous Item class usage in SpinBoxExt

IconLabel already exists in Qt namespace

- - - - -
24dc8002 by Pierre Lamot at 2024-04-25T05:18:16+00:00
qml: fix description in teletext widgets

description field should be used since d6b6ac32c25c561bab27c7775659cba2ac31a570

- - - - -
6717dd67 by Pierre Lamot at 2024-04-25T05:18:16+00:00
qml: fix invalid property in TeletextWidget

IconToolButton relies on the font size since 3df6a79acd84ca0b63a90942fff97e8f7cd54a7a

- - - - -


7 changed files:

- modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
- modules/gui/qt/medialibrary/qml/VideoAllSubDisplay.qml
- modules/gui/qt/medialibrary/qml/VideoRecentVideos.qml
- modules/gui/qt/player/qml/controlbarcontrols/TeletextWidget.qml
- modules/gui/qt/util/qml/ViewDragAutoScrollHandler.qml
- modules/gui/qt/widgets/qml/FadingEdgeForListView.qml
- modules/gui/qt/widgets/qml/SpinBoxExt.qml


Changes:

=====================================
modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
=====================================
@@ -421,7 +421,7 @@ FocusScope {
 
             rowHeight: VLCStyle.tableRow_height
 
-            parentId: Helpers.get(root.model, "id")
+            parentId: root.model?.id
             onParentIdChanged: {
                 currentIndex = 0
             }


=====================================
modules/gui/qt/medialibrary/qml/VideoAllSubDisplay.qml
=====================================
@@ -266,7 +266,7 @@ VideoAll {
         leftPadding: root.leftPadding
         rightPadding: root.rightPadding
 
-        nbItemPerRow: Helpers.get(root.currentItem, "nbItemPerRow", 0)
+        nbItemPerRow: root.currentItem?.nbItemPerRow ?? 0
 
         subtitleText: (root.model && root.model.count > 0) ? qsTr("Videos") : ""
 


=====================================
modules/gui/qt/medialibrary/qml/VideoRecentVideos.qml
=====================================
@@ -93,8 +93,8 @@ FocusScope {
 
             Layout.fillWidth: true
 
-            leftPadding: Helpers.get(view.currentItem, "contentLeftMargin", 0)
-            rightPadding: Helpers.get(view.currentItem, "contentRightMargin", 0)
+            leftPadding: view.currentItem?.contentLeftMargin ?? 0
+            rightPadding: view.currentItem?.contentRightMargin ?? 0
             topPadding: 0
 
             text: qsTr("Continue Watching")
@@ -116,7 +116,7 @@ FocusScope {
             visible: recentModel.count > 0
 
             width: root.width
-            height: currentItem.contentHeight
+            height: currentItem?.contentHeight ?? 0
 
             leftPadding: root.leftPadding
             rightPadding: root.rightPadding
@@ -149,7 +149,7 @@ FocusScope {
 
             view: root
 
-            leftPadding: Helpers.get(view.currentItem, "contentLeftMargin", 0)
+            leftPadding: view.currentItem?.contentLeftMargin ?? 0
             topPadding: MainCtx.gridView ? VLCStyle.gridView_spacing + VLCStyle.margin_xsmall + VLCStyle.margin_xxxsmall
                                          : VLCStyle.tableView_spacing
 


=====================================
modules/gui/qt/player/qml/controlbarcontrols/TeletextWidget.qml
=====================================
@@ -173,10 +173,6 @@ T.Pane {
 
                 anchors.verticalCenter: parent.verticalCenter
 
-                width: redKeyBtn.width
-
-                size: VLCStyle.dp(32, VLCStyle.scale)
-
                 enabled: teleActivateBtn.checked
 
                 text: VLCIcons.home
@@ -197,7 +193,7 @@ T.Pane {
 
                 enabled: teleActivateBtn.checked
 
-                text: qsTr("Red key")
+                description: qsTr("Red key")
 
                 color: root._teletextButtonColor(this, "red")
 
@@ -216,7 +212,7 @@ T.Pane {
 
                 enabled: teleActivateBtn.checked
 
-                text: qsTr("Green key")
+                description: qsTr("Green key")
 
                 color: root._teletextButtonColor(this, "green")
 
@@ -235,7 +231,7 @@ T.Pane {
 
                 enabled: teleActivateBtn.checked
 
-                text: qsTr("Yellow key")
+                description: qsTr("Yellow key")
 
                 color: root._teletextButtonColor(this, "yellow")
 
@@ -254,7 +250,7 @@ T.Pane {
 
                 enabled: teleActivateBtn.checked
 
-                text: qsTr("Blue key")
+                description: qsTr("Blue key")
 
                 color: root._teletextButtonColor(this, "blue")
 


=====================================
modules/gui/qt/util/qml/ViewDragAutoScrollHandler.qml
=====================================
@@ -28,7 +28,7 @@ QtObject {
     // if 'dragItem' is null, user must override property 'dragging' and 'dragPosProvider'
     property Item dragItem: null
 
-    property bool dragging: dragItem?.visible
+    property bool dragging: dragItem?.visible ?? false
 
     property var dragPosProvider: function () {
         return root.view.mapFromItem(root.dragItem.parent,


=====================================
modules/gui/qt/widgets/qml/FadingEdgeForListView.qml
=====================================
@@ -42,7 +42,7 @@ FadingEdge {
                                                 listView.addDisplaced?.running ||
                                                 listView.populate?.running ||
                                                 listView.remove?.running ||
-                                                listView.removeDisplaced?.running)
+                                                listView.removeDisplaced?.running) ?? false
 
     // FIXME: Delegate with variable size
     readonly property Item delegateItem: listView.itemAtIndex(0)


=====================================
modules/gui/qt/widgets/qml/SpinBoxExt.qml
=====================================
@@ -23,6 +23,7 @@ import QtQuick.Templates as T
 import org.videolan.vlc 0.1
 
 import "qrc:///style/"
+import "qrc:///widgets/" as Widgets
 
 T.SpinBox {
     id: control
@@ -126,7 +127,7 @@ T.SpinBox {
             focused: false
         }
 
-        IconLabel {
+        Widgets.IconLabel {
             text: VLCIcons.chevron_up
             font.pixelSize: control.font.pixelSize * 2
             color: upTheme.fg.primary
@@ -159,7 +160,7 @@ T.SpinBox {
             focused: false
         }
 
-        IconLabel {
+        Widgets.IconLabel {
             text: VLCIcons.chevron_down
             font.pixelSize: control.font.pixelSize * 2
             color: downTheme.fg.primary



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/4e67f8341b169ccdfbcfd682067590af24fb0079...6717dd6741e8b87d3bec8e3153304e5564ab08b1

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/4e67f8341b169ccdfbcfd682067590af24fb0079...6717dd6741e8b87d3bec8e3153304e5564ab08b1
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