[vlc-devel] [PATCH 24/27] qml: fix navigation when active focused IconToolButton becomes disabled

Fatih Uzunoglu fuzun54 at outlook.com
Fri Dec 4 00:01:59 CET 2020


---
 modules/gui/qt/widgets/qml/IconToolButton.qml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/modules/gui/qt/widgets/qml/IconToolButton.qml b/modules/gui/qt/widgets/qml/IconToolButton.qml
index 47c51ff673..b90be77273 100644
--- a/modules/gui/qt/widgets/qml/IconToolButton.qml
+++ b/modules/gui/qt/widgets/qml/IconToolButton.qml
@@ -38,6 +38,18 @@ ToolButton {
 
     enabled: !paintOnly
 
+    onActiveFocusChanged: {
+        if (!enabled) {
+            var keyNavigationLeft = control.KeyNavigation.left
+            var keyNavigationRight = control.KeyNavigation.right
+
+            if (!!keyNavigationLeft)
+                keyNavigationLeft.forceActiveFocus()
+            else if (!!keyNavigationRight)
+                keyNavigationRight.forceActiveFocus()
+        }
+    }
+
     contentItem: Item {
 
         Label {
-- 
2.27.0



More information about the vlc-devel mailing list