[vlc-commits] qml: show menu on common cancel keys in the player

Pierre Lamot git at videolan.org
Mon Oct 14 11:59:37 CEST 2019


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Thu Sep 26 16:01:43 2019 +0200| [5f1bbc1c5b45bdd0de94e4d6fee46d410b5d7701] | committer: Jean-Baptiste Kempf

qml: show menu on common cancel keys in the player

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

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

 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);



More information about the vlc-commits mailing list