[vlc-devel] [PATCH 07/29] qml: remove unnecessary property aliases and FocusScope from MusicArtistDisplay

Prince Gupta guptaprince8832 at gmail.com
Tue Aug 4 13:34:40 CEST 2020


---
 .../medialibrary/qml/MusicArtistsDisplay.qml  | 65 ++++++++-----------
 1 file changed, 28 insertions(+), 37 deletions(-)

diff --git a/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml b/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
index 71474c99c2..02e64bbde7 100644
--- a/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
@@ -61,7 +61,7 @@ Widgets.NavigableFocusScope {
     }
 
     function _actionAtIndex(index) {
-        view.forceActiveFocus()
+        albumSubView.forceActiveFocus()
     }
 
     MLArtistModel {
@@ -114,7 +114,7 @@ Widgets.NavigableFocusScope {
             }
 
             navigationParent: root
-            navigationRightItem: view
+            navigationRightItem: albumSubView
             navigationCancel: function() {
                 if (artistList.currentIndex <= 0)
                     defaultNavigationCancel()
@@ -156,54 +156,45 @@ Widgets.NavigableFocusScope {
                     if (keys === Qt.RightButton)
                         medialib.addAndPlay( model.id )
                     else
-                        view.forceActiveFocus()
+                        albumSubView.forceActiveFocus()
                 }
             }
 
         }
 
-        FocusScope {
-            id: view
-            width: parent.width * 0.75
-            height: parent.height
-
-            property alias currentIndex: albumSubView.currentIndex
-            property alias initialIndex: albumSubView.initialIndex
-
-            MusicAlbums {
-                id: albumSubView
-
-                anchors.fill: parent
-                gridViewMarginTop: 0
-
-                header: ArtistTopBanner {
-                    id: artistBanner
-                    width: albumSubView.width
-                    artist: (artistList.currentIndex >= 0)
-                            ? artistModel.getDataAt(artistList.currentIndex)
-                            : ({})
-                    navigationParent: root
-                    navigationLeftItem: artistList
-                    navigationDown: function() {
-                        artistBanner.focus = false
-                        view.forceActiveFocus()
-                    }
-                }
 
-                focus: true
-                parentId: artistId
-                initialIndex: root.initialAlbumIndex
+        MusicAlbums {
+            id: albumSubView
 
+            height: parent.height
+            width: parent.width * .75
+            gridViewMarginTop: 0
+            focus: true
+            parentId: root.artistId
+            initialIndex: root.initialAlbumIndex
+            navigationParent: root
+            navigationUpItem: albumSubView.headerItem
+            navigationLeftItem: artistList
+
+            header: ArtistTopBanner {
+                id: artistBanner
+                width: albumSubView.width
+                artist: (artistList.currentIndex >= 0)
+                        ? artistModel.getDataAt(artistList.currentIndex)
+                        : ({})
                 navigationParent: root
-                navigationUpItem: albumSubView.headerItem
                 navigationLeftItem: artistList
-
-                onCurrentIndexChanged: {
-                    history.update(["mc", "music", "artists", {"initialIndex" : root.currentIndex, "initialAlbumIndex": albumSubView.currentIndex  }])
+                navigationDown: function() {
+                    artistBanner.focus = false
+                    view.forceActiveFocus()
                 }
             }
 
+            onCurrentIndexChanged: {
+                history.update(["mc", "music", "artists", {"initialIndex" : root.currentIndex, "initialAlbumIndex": albumSubView.currentIndex  }])
+            }
         }
+
     }
     }
 
-- 
2.25.1



More information about the vlc-devel mailing list