[vlc-devel] [PATCH 6/9] qml: use SubtitleLabel for header of Genre albums view and align texts with content

Prince Gupta guptaprince8832 at gmail.com
Mon Aug 10 15:20:27 CEST 2020


---
 modules/gui/qt/medialibrary/qml/MusicAlbums.qml        | 1 +
 modules/gui/qt/medialibrary/qml/MusicGenresDisplay.qml | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/medialibrary/qml/MusicAlbums.qml b/modules/gui/qt/medialibrary/qml/MusicAlbums.qml
index 224ec52180..983a0eefdc 100644
--- a/modules/gui/qt/medialibrary/qml/MusicAlbums.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicAlbums.qml
@@ -42,6 +42,7 @@ Widgets.NavigableFocusScope {
     //the index to "go to" when the view is loaded
     property var initialIndex: 0
     property int gridViewMarginTop: VLCStyle.margin_large
+    property var gridViewRowX: medialib.gridView ? view.currentItem.rowX : undefined
 
     navigationCancel: function() {
         if (view.currentItem.currentIndex <= 0) {
diff --git a/modules/gui/qt/medialibrary/qml/MusicGenresDisplay.qml b/modules/gui/qt/medialibrary/qml/MusicGenresDisplay.qml
index 945673813c..5f442f79d9 100644
--- a/modules/gui/qt/medialibrary/qml/MusicGenresDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicGenresDisplay.qml
@@ -88,10 +88,17 @@ Widgets.NavigableFocusScope {
         id: albumGenreComponent
         /* List View */
         MusicAlbums {
+            id: albumsView
+
             property string genreName: ""
 
-            header: Widgets.LabelSeparator {
+            gridViewMarginTop: 0
+
+            header: Widgets.SubtitleLabel {
                 text: i18n.qtr("Genres - %1").arg(genreName)
+                leftPadding: (albumsView.gridViewRowX || VLCStyle.margin_large)
+                topPadding: VLCStyle.margin_large
+                bottomPadding: VLCStyle.margin_normal
                 width: root.width
             }
 
-- 
2.25.1



More information about the vlc-devel mailing list