[vlc-commits] [Git][videolan/vlc][master] qml: use focus scope to encapsulate the media library and playlist list views

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Jan 18 14:54:26 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
5db139a9 by Fatih Uzunoglu at 2025-01-18T14:42:29+00:00
qml: use focus scope to encapsulate the media library and playlist list views

Currently if the user goes up or down from the playlist view, going back ends
up with the media library view getting the focus. I think it is better to
focus to the last focused view.

- - - - -


1 changed file:

- modules/gui/qt/maininterface/qml/MainDisplay.qml


Changes:

=====================================
modules/gui/qt/maininterface/qml/MainDisplay.qml
=====================================
@@ -199,14 +199,18 @@ FocusScope {
             }
 
             Navigation.parentItem: mainColumn
-            Navigation.downItem: stackView
+            Navigation.downItem: mainRow
         }
 
-        Item {
+        FocusScope {
+            id: mainRow
+
             Layout.fillWidth: true
             Layout.fillHeight: true
             z: 0
 
+            focus: true
+
             Rectangle {
                 id: stackViewParent
 
@@ -321,6 +325,12 @@ FocusScope {
 
                 readonly property bool shown: (status === Loader.Ready) && item.visible
 
+                onVisibleChanged: {
+                    if (!visible) {
+                        stackView.focus = true
+                    }
+                }
+
                 Component.onCompleted: {
                     Qt.callLater(() => { playlistTransition.enabled = true; })
                 }
@@ -533,7 +543,7 @@ FocusScope {
         background.visible: !stackViewParent.layer.enabled
 
         Navigation.parentItem: mainColumn
-        Navigation.upItem: stackView
+        Navigation.upItem: mainRow
         Navigation.cancelItem:sourcesBanner
         onVisibleChanged: {
             if (!visible && miniPlayer.activeFocus)



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

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