[vlc-commits] qml: avoid focus loss when localMenuGroup gets hidden in the banner

Pierre Lamot git at videolan.org
Fri Feb 14 12:00:13 CET 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Thu Jan 30 10:40:54 2020 +0100| [b30d2ba0761be1d43ef5e5e99f2a0c478cd2318f] | committer: Jean-Baptiste Kempf

qml: avoid focus loss when localMenuGroup gets hidden in the banner

  this can happen when navigating back from album to video view

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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



More information about the vlc-commits mailing list