[vlc-commits] qml: scroll the header with content of the artist pane of the artist view

Pierre Lamot git at videolan.org
Fri Sep 6 18:02:07 CEST 2019


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Fri Sep  6 15:41:52 2019 +0200| [870f2e4e0e2936647f8bcede45616805cc06839a] | committer: Jean-Baptiste Kempf

qml: scroll the header with content of the artist pane of the artist view

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=870f2e4e0e2936647f8bcede45616805cc06839a
---

 .../gui/qt/qml/mediacenter/MusicArtistsDisplay.qml | 42 ++++++++++------------
 1 file changed, 19 insertions(+), 23 deletions(-)

diff --git a/modules/gui/qt/qml/mediacenter/MusicArtistsDisplay.qml b/modules/gui/qt/qml/mediacenter/MusicArtistsDisplay.qml
index b407dd300f..8171593fb2 100644
--- a/modules/gui/qt/qml/mediacenter/MusicArtistsDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/MusicArtistsDisplay.qml
@@ -76,18 +76,14 @@ Utils.NavigableFocusScope {
             }
 
             onPlayClicked: {
-                console.log('Clicked on play : '+model.name);
                 medialib.addAndPlay( model.id )
             }
             onAddToPlaylistClicked: {
-                console.log('Clicked on addToPlaylist : '+model.name);
                 medialib.addToPlaylist( model.id );
             }
         }
 
         function actionAtIndex(index) {
-            console.log("actionAtIndex", index)
-            artistBanner.artist = delegateModel.items.get(index).model
             if (delegateModel.selectedGroup.count > 1) {
                 var list = []
                 for (var i = 0; i < delegateModel.selectedGroup.count; i++)
@@ -146,30 +142,30 @@ Utils.NavigableFocusScope {
             height: parent.height
 
             property alias currentIndex: albumSubView.currentIndex
-            ColumnLayout {
+
+            MusicAlbumsDisplay {
+                id: albumSubView
                 anchors.fill: parent
-                ArtistTopBanner {
+
+                header: ArtistTopBanner {
                     id: artistBanner
-                    Layout.fillWidth: true
+                    width: albumSubView.width
                     focus: false
-                    //contentY: albumsView.contentY
-                    contentY: 0
-                    artist: undefined
-                }
-                MusicAlbumsDisplay {
-                    id: albumSubView
-                    Layout.fillWidth: true
-                    Layout.fillHeight: true
-                    focus: true
-                    parentId: artistId
-                    onActionLeft: artistList.focus = true
-
-                    onActionRight: root.actionRight(index)
-                    onActionUp: root.actionUp(index)
-                    onActionDown: root.actionDown(index)
-                    onActionCancel: root.actionCancel(index)
+                    artist: (artistList.currentIndex >= 0)
+                        ? delegateModel.items.get(artistList.currentIndex).model
+                        : ({})
                 }
+
+                focus: true
+                parentId: artistId
+                onActionLeft: artistList.focus = true
+
+                onActionRight: root.actionRight(index)
+                onActionUp: root.actionUp(index)
+                onActionDown: root.actionDown(index)
+                onActionCancel: root.actionCancel(index)
             }
+
         }
     }
 



More information about the vlc-commits mailing list