[vlc-commits] [Git][videolan/vlc][master] 3 commits: qml: fix coding style

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri May 24 13:29:41 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
39bb942a by Prince Gupta at 2024-05-24T13:10:37+00:00
qml: fix coding style

- - - - -
1e9c0cf4 by Prince Gupta at 2024-05-24T13:10:37+00:00
qml: fix picture overlay of genre view

scoping and generic name of root grid item of this view
was causing invalid object access in this view

fix: use direct parent as reference for size
NOTE: changing the name of parent grid item also fixes this issue

- - - - -
7ab0776c by Prince Gupta at 2024-05-24T13:10:37+00:00
qml: don't use generic name for delegate

this causes scope resolution errors for child components

- - - - -


1 changed file:

- modules/gui/qt/medialibrary/qml/MusicGenres.qml


Changes:

=====================================
modules/gui/qt/medialibrary/qml/MusicGenres.qml
=====================================
@@ -127,7 +127,7 @@ MainInterface.MainViewLoader {
             headerDelegate: root.header
 
             delegate: Widgets.GridItem {
-                id: item
+                id: genreGridDelegate
 
                 property var model: ({})
                 property int index: -1
@@ -146,7 +146,7 @@ MainInterface.MainViewLoader {
                 dragItem: genreDragItem
 
                 onItemDoubleClicked: (_,_,modifier) => { root.showAlbumView(model.id, model.name, Qt.MouseFocusReason) }
-                onItemClicked: (_,_,modifier) => { gridView_id.leftClickOnItem(modifier, item.index) }
+                onItemClicked: (_,_,modifier) => { gridView_id.leftClickOnItem(modifier, genreGridDelegate.index) }
 
                 onPlayClicked: {
                     if (model.id)
@@ -159,8 +159,9 @@ MainInterface.MainViewLoader {
                 }
 
                 pictureOverlay: Item {
-                    Rectangle
-                    {
+                    id: overlay
+
+                    Rectangle {
                         anchors.fill: parent
 
                         radius: VLCStyle.gridCover_radius
@@ -176,17 +177,17 @@ MainInterface.MainViewLoader {
 
                         //FIXME use the right xxxLabel class
                         T.Label {
-                             width: item.width
-                             elide: Text.ElideRight
-                             font.pixelSize: VLCStyle.fontSize_large
-                             font.weight: Font.DemiBold
-                             text: model.name || qsTr("Unknown genre")
-                             color: "white"
-                             horizontalAlignment: Text.AlignHCenter
+                            width: overlay.width
+                            elide: Text.ElideRight
+                            font.pixelSize: VLCStyle.fontSize_large
+                            font.weight: Font.DemiBold
+                            text: model.name || qsTr("Unknown genre")
+                            color: "white"
+                            horizontalAlignment: Text.AlignHCenter
                         }
 
                         Widgets.CaptionLabel {
-                            width: item.width
+                            width: overlay.width
                             text: model.nb_tracks > 1 ? qsTr("%1 Tracks").arg(model.nb_tracks) : qsTr("%1 Track").arg(model.nb_tracks)
                             opacity: .7
                             color: "white"



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d5de42f4810d33d39d89cf84ea2ecf6e6053111f...7ab0776c2a11fdf242fafb29e57344014037648b

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d5de42f4810d33d39d89cf84ea2ecf6e6053111f...7ab0776c2a11fdf242fafb29e57344014037648b
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