[vlc-commits] [Git][videolan/vlc][master] qml/MusicArtistsAlbums: fix keyboard navigation in small layout

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Jan 30 07:11:27 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
cf545379 by Yann Lochet at 2023-01-30T06:49:16+00:00
qml/MusicArtistsAlbums: fix keyboard navigation in small layout

When entering MusicArtistsAlbums in small layout the focus was not set
on MusicArtist

- - - - -


2 changed files:

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


Changes:

=====================================
modules/gui/qt/medialibrary/qml/MusicArtist.qml
=====================================
@@ -205,6 +205,10 @@ FocusScope {
     }
 
     function setCurrentItemFocus(reason) {
+        if (view.currentItem === null) {
+            Qt.callLater(setCurrentItemFocus, reason)
+            return
+        }
         view.currentItem.setCurrentItemFocus(reason);
     }
 


=====================================
modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml
=====================================
@@ -53,12 +53,22 @@ FocusScope {
     property alias currentAlbumIndex: albumSubView.currentIndex
 
     property alias currentArtist: albumSubView.artist
+    property bool isScreenSmall: VLCStyle.isScreenSmall
 
     onInitialAlbumIndexChanged: resetFocus()
     onInitialIndexChanged: resetFocus()
     onCurrentIndexChanged: currentArtist = model.getDataAt(currentIndex)
+    onIsScreenSmallChanged: {
+        if (VLCStyle.isScreenSmall)
+            resetFocus()
+    }
 
     function resetFocus() {
+        if (VLCStyle.isScreenSmall) {
+            albumSubView.setCurrentItemFocus(Qt.OtherFocusReason)
+            return
+        }
+
         if (artistModel.count === 0) {
             return
         }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/cf54537974963b208341f476d7ddca342afaaeaf

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/cf54537974963b208341f476d7ddca342afaaeaf
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