[vlc-devel] [PATCH 37/49] qml: show menu on common cancel keys in the player

Pierre Lamot pierre at videolabs.io
Fri Oct 11 15:18:01 CEST 2019


---
 modules/gui/qt/qml/player/Player.qml | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/qml/player/Player.qml b/modules/gui/qt/qml/player/Player.qml
index 74e72e8c77..07cd3a72b0 100644
--- a/modules/gui/qt/qml/player/Player.qml
+++ b/modules/gui/qt/qml/player/Player.qml
@@ -120,7 +120,11 @@ Utils.NavigableFocusScope {
         property point mousePosition: Qt.point(0,0)
 
         Keys.onPressed: {
-            if (event.key === Qt.Key_Menu) {
+            if (event.key === Qt.Key_Menu
+                    || event.key === Qt.Key_Back
+                    || event.key === Qt.Key_Backspace
+                    || event.matches(StandardKey.Back)
+                    || event.matches(StandardKey.Cancel)) {
                 toolbarAutoHide.toggleForceVisible()
             }
         }
@@ -170,7 +174,10 @@ Utils.NavigableFocusScope {
             Keys.onPressed: {
                 if (event.accepted)
                     return
-                if (event.key === Qt.Key_Menu) {
+                if (event.key === Qt.Key_Menu
+                        || event.key === Qt.Key_Backspace
+                        || event.matches(StandardKey.Back)
+                        || event.matches(StandardKey.Cancel)) {
                     toolbarAutoHide.toggleForceVisible()
                 } else {
                     rootWindow.sendHotkey(event.key, event.modifiers);
@@ -267,7 +274,10 @@ Utils.NavigableFocusScope {
                     Keys.onPressed: {
                         if (event.accepted)
                             return
-                        if (event.key === Qt.Key_Menu)
+                        if (event.key === Qt.Key_Menu
+                                || event.key === Qt.Key_Backspace
+                                || event.matches(StandardKey.Back)
+                                || event.matches(StandardKey.Cancel))
                             toolbarAutoHide.toggleForceVisible()
                         else
                             rootWindow.sendHotkey(event.key, event.modifiers);
-- 
2.20.1



More information about the vlc-devel mailing list