[vlc-devel] [PATCH 09/10] qml: fix space event being handled twice while muting volume widget
Pierre Lamot
pierre at videolabs.io
Mon Nov 18 18:14:12 CET 2019
---
modules/gui/qt/qml/player/VolumeWidget.qml | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/modules/gui/qt/qml/player/VolumeWidget.qml b/modules/gui/qt/qml/player/VolumeWidget.qml
index 59810fb439..d9174150f5 100644
--- a/modules/gui/qt/qml/player/VolumeWidget.qml
+++ b/modules/gui/qt/qml/player/VolumeWidget.qml
@@ -22,6 +22,7 @@ import QtGraphicalEffects 1.0
import "qrc:///utils/" as Utils
import "qrc:///style/"
+import "qrc:///utils/KeyHelper.js" as KeyHelper
FocusScope{
id: widgetfscope
@@ -71,7 +72,15 @@ FocusScope{
opacity: player.muted ? 0.5 : 1
focus: true
- Keys.onSpacePressed: player.muted = !player.muted
+ Keys.onReleased: {
+ if (event.accepted)
+ return;
+ if (KeyHelper.matchOk(event)) {
+ player.muted = !player.muted
+ event.accepted = true
+ }
+ }
+
Keys.onUpPressed: volControl.increase()
Keys.onDownPressed: volControl.decrease()
Keys.onRightPressed: {
--
2.17.1
More information about the vlc-devel
mailing list