[vlc-commits] qml: make ListItem respond to the Ok key

Pierre Lamot git at videolan.org
Fri Jan 10 15:06:25 CET 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Fri Dec 13 14:21:23 2019 +0100| [039311b92e04596bce769fea7d77c9c13c2bcc3a] | committer: Jean-Baptiste Kempf

qml: make ListItem respond to the Ok key

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

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

 modules/gui/qt/widgets/qml/ListItem.qml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/widgets/qml/ListItem.qml b/modules/gui/qt/widgets/qml/ListItem.qml
index 7837d0961d..0e9dc97dcd 100644
--- a/modules/gui/qt/widgets/qml/ListItem.qml
+++ b/modules/gui/qt/widgets/qml/ListItem.qml
@@ -23,6 +23,7 @@ import QtGraphicalEffects 1.0
 
 import "qrc:///style/"
 import "qrc:///widgets/" as Widgets
+import "qrc:///util/KeyHelper.js" as KeyHelper
 
 NavigableFocusScope {
     id: root
@@ -177,6 +178,12 @@ NavigableFocusScope {
                         Keys.onLeftPressed: {
                             root.navigationLeft(0)
                         }
+
+                        Keys.onReleased: {
+                            if (KeyHelper.matchOk(event)) {
+                                itemDoubleClicked(event.key, event.modifiers)
+                            }
+                        }
                     }
 
                     FocusScope {
@@ -234,4 +241,3 @@ NavigableFocusScope {
         }
     }
 }
-



More information about the vlc-commits mailing list