[vlc-commits] [Git][videolan/vlc][master] qml: handle padding properly in MusicArtistsAlbums
    François Cartegnie (@fcartegnie) 
    gitlab at videolan.org
       
    Fri Aug 30 09:41:36 UTC 2024
    
    
  
François Cartegnie pushed to branch master at VideoLAN / VLC
Commits:
89eda428 by Fatih Uzunoglu at 2024-08-30T08:44:38+00:00
qml: handle padding properly in MusicArtistsAlbums
The row layout here can be considered the content item.
Padding of the root should be applied as margin for the
content item, like how `Control` behaves.
Currently, delegate is not positioned properly. The
leftmost side of the delegate should begin after the
safe margin.
This also enables taking care of the minimum width for
the row layout when there is padding.
- - - - -
1 changed file:
- modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml
Changes:
=====================================
modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml
=====================================
@@ -123,8 +123,8 @@ FocusScope {
       id: artistListBackground
 
       visible: artistList.visible
-      width: artistList.width
-      height: artistList.height + artistList.displayMarginEnd
+      width: parent.width
+      height: parent.height + artistList.displayMarginEnd
 
       tintColor: artistList.colorContext.bg.secondary
 
@@ -133,6 +133,8 @@ FocusScope {
 
     RowLayout {
         anchors.fill: parent
+        anchors.leftMargin: root.leftPadding
+        anchors.rightMargin: root.rightPadding
 
         visible: artistModel.count > 0
 
@@ -182,7 +184,7 @@ FocusScope {
             header: Widgets.ViewHeader {
                 view: artistList
 
-                leftPadding: root.leftPadding + VLCStyle.margin_normal
+                leftPadding: VLCStyle.margin_normal
                 topPadding: VLCStyle.margin_xlarge
                 bottomPadding: VLCStyle.margin_small
 
@@ -200,9 +202,7 @@ FocusScope {
             }
 
             delegate: MusicArtistDelegate {
-                width: artistList.width
-
-                leftPadding: rightPadding + root.leftPadding
+                width: artistList.contentWidth
 
                 isCurrent: ListView.isCurrentItem
 
@@ -249,6 +249,9 @@ FocusScope {
 
     Widgets.EmptyLabelButton {
         anchors.fill: parent
+        anchors.leftMargin: root.leftPadding
+        anchors.rightMargin: root.rightPadding
+
         visible: !artistModel.loading && (artistModel.count <= 0)
         focus: visible
         text: qsTr("No artists found\nPlease try adding sources, by going to the Browse tab")
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/89eda42851eed8090df80b026fdfd6f0590e1ff7
-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/89eda42851eed8090df80b026fdfd6f0590e1ff7
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