[vlc-commits] [Git][videolan/vlc][master] 3 commits: qml/MusicArtistsAlbums: Fix 'artistList' rounding issue

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Feb 4 15:05:48 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
caf39a0c by Benjamin Arnaud at 2023-02-04T14:53:01+00:00
qml/MusicArtistsAlbums: Fix 'artistList' rounding issue

- - - - -
6169e8f3 by Benjamin Arnaud at 2023-02-04T14:53:01+00:00
qml/ArtistTopBanner: Adjust safe margins behavior

- - - - -
175877c0 by Benjamin Arnaud at 2023-02-04T14:53:01+00:00
qml/MusicArtist: Update the padding implementation

- - - - -


3 changed files:

- modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml
- modules/gui/qt/medialibrary/qml/MusicArtist.qml
- modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml


Changes:

=====================================
modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml
=====================================
@@ -32,6 +32,8 @@ import "qrc:///util/Helpers.js" as Helpers
 FocusScope {
     id: root
 
+    property int rightPadding: 0
+
     property var artist: ({})
 
     implicitHeight: VLCStyle.artistBanner_height
@@ -42,6 +44,8 @@ FocusScope {
 
     Image {
         id: background
+
+        // NOTE: We want the banner to ignore safe margins.
         anchors.fill: parent
 
         asynchronous: true
@@ -82,10 +86,11 @@ FocusScope {
     RowLayout {
         id: col
 
-        anchors.fill: background
+        anchors.fill: parent
         anchors.topMargin: VLCStyle.margin_xxlarge
         anchors.bottomMargin: VLCStyle.margin_xxlarge
         anchors.leftMargin: VLCStyle.margin_xlarge
+        anchors.rightMargin: root.rightPadding
 
         spacing: VLCStyle.margin_normal
 
@@ -109,24 +114,30 @@ FocusScope {
         }
 
         ColumnLayout {
-            spacing: 0
-
             Layout.fillWidth: true
 
+            // NOTE: The layout can be resized to zero to hide the text entirely.
+            Layout.minimumWidth: 0
+
+            Layout.rightMargin: VLCStyle.margin_small
+
+            spacing: 0
+
             Widgets.SubtitleLabel {
+                Layout.fillWidth: true
+
                 text: artist.name || I18n.qtr("No artist")
                 color: "white"
-
-                Layout.maximumWidth: parent.width
             }
 
             Widgets.MenuCaption {
+                Layout.fillWidth: true
+
+                Layout.topMargin: VLCStyle.margin_xxxsmall
+
                 text: I18n.qtr("%1 Songs").arg(artist.nb_tracks)
                 color: "white"
                 opacity: .6
-
-                Layout.topMargin: VLCStyle.margin_xxxsmall
-                Layout.maximumWidth: parent.width
             }
 
             Widgets.NavigableRow {


=====================================
modules/gui/qt/medialibrary/qml/MusicArtist.qml
=====================================
@@ -31,8 +31,6 @@ import "qrc:///style/"
 FocusScope {
     id: root
 
-    property int rightPadding: 0
-
     property var artist: ({})
 
     //the index to "go to" when the view is loaded
@@ -50,6 +48,8 @@ FocusScope {
            return headerItem.albumsListView.currentIndex
     }
 
+    property alias rightPadding: view.rightPadding
+
     property alias _currentView: view.currentItem
 
     property Component header: FocusScope {
@@ -60,7 +60,7 @@ FocusScope {
 
         focus: true
         height: col.height
-        width: root.width - root.rightPadding
+        width: root.width
 
         function setCurrentItemFocus(reason) {
             if (albumsListView)
@@ -81,6 +81,9 @@ FocusScope {
 
                 focus: true
                 width: headerFs.width
+
+                rightPadding: root.rightPadding
+
                 artist: root.artist
                 Navigation.parentItem: root
                 Navigation.downAction: function() {
@@ -100,7 +103,7 @@ FocusScope {
                 sourceComponent: Column {
                     property alias albumsListView: albumsList
 
-                    width: root.width
+                    width: albumsList.width
                     height: implicitHeight
 
                     Widgets.SubtitleLabel {
@@ -116,8 +119,10 @@ FocusScope {
                         id: albumsList
 
                         focus: true
+
                         height: VLCStyle.gridItem_music_height + VLCStyle.margin_normal
-                        width: root.width
+                        width: root.width - root.rightPadding
+
                         leftMargin: VLCStyle.margin_xlarge
                         topMargin: VLCStyle.margin_xsmall
                         bottomMargin: VLCStyle.margin_xsmall
@@ -474,8 +479,6 @@ FocusScope {
 
         anchors.fill: parent
 
-        rightPadding: root.rightPadding
-
         focus: albumModel.count !== 0
         initialItem: MainCtx.gridView ? gridComponent : tableComponent
 


=====================================
modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml
=====================================
@@ -147,9 +147,9 @@ FocusScope {
             height: parent.height
             width: VLCStyle.isScreenSmall
                    ? 0
-                   : Helpers.clamp(root.width / resizeHandle.widthFactor,
-                                   VLCStyle.colWidth(1) + VLCStyle.column_spacing,
-                                   root.width * .5)
+                   : Math.round(Helpers.clamp(root.width / resizeHandle.widthFactor,
+                                              VLCStyle.colWidth(1) + VLCStyle.column_spacing,
+                                              root.width * .5))
 
             visible: !VLCStyle.isScreenSmall && (artistModel.count > 0)
             focus: !VLCStyle.isScreenSmall && (artistModel.count > 0)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/901726ac42b2f87c0baf70be3ff69bee63bd21a2...175877c0a1d2195d4c02ab2718a99f8a29024352

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/901726ac42b2f87c0baf70be3ff69bee63bd21a2...175877c0a1d2195d4c02ab2718a99f8a29024352
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