[vlc-commits] qml: fix space event being handled twice while muting volume widget
Pierre Lamot
git at videolan.org
Tue Nov 19 16:50:00 CET 2019
vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Fri Nov 15 16:59:46 2019 +0100| [4396b6e5a0bdfdb481341a8468120d175b886f63] | committer: Jean-Baptiste Kempf
qml: fix space event being handled twice while muting volume widget
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4396b6e5a0bdfdb481341a8468120d175b886f63
---
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: {
More information about the vlc-commits
mailing list