[vlc-devel] [PATCH 22/22] qml: avoid focus loss when localMenuGroup gets hidden in the banner

Pierre Lamot pierre at videolabs.io
Fri Feb 14 11:23:57 CET 2020


  this can happen when navigating back from album to video view
---
 modules/gui/qt/maininterface/qml/BannerSources.qml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/gui/qt/maininterface/qml/BannerSources.qml b/modules/gui/qt/maininterface/qml/BannerSources.qml
index 412ca53492..614ad7d107 100644
--- a/modules/gui/qt/maininterface/qml/BannerSources.qml
+++ b/modules/gui/qt/maininterface/qml/BannerSources.qml
@@ -266,6 +266,14 @@ Widgets.NavigableFocusScope {
 
                     visible: !!model
                     enabled: !!model
+                    onVisibleChanged: {
+                        //reset the focus on the global group when the local group is hidden,
+                        //this avoids losing the focus if the subview changes
+                        if (!visible && localMenuGroup.focus) {
+                                        localMenuGroup.focus = false
+                                        globalMenuGroup.focus = true
+                        }
+                    }
 
                     delegate: Widgets.TabButtonExt {
                         text: model.displayText
-- 
2.17.1



More information about the vlc-devel mailing list