[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: do not set grab permissions in SliderBar tap handler

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sun Jul 21 13:41:45 UTC 2024



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
e7147dfb by Fatih Uzunoglu at 2024-07-21T13:21:48+00:00
qml: do not set grab permissions in SliderBar tap handler

It appears that setting the gesture policy is enough, and
setting grab permission to `CanTakeOverFromAnything` seems
to be conflicting with the drag handler.

- - - - -
dfc421a5 by Fatih Uzunoglu at 2024-07-21T13:21:48+00:00
qml: set proper states for the FSM in SliderBar tap handler

`tapped()` is a signal that is emitted on release, not press.
Therefore, currently the state is not set properly.

- - - - -


1 changed file:

- modules/gui/qt/player/qml/SliderBar.qml


Changes:

=====================================
modules/gui/qt/player/qml/SliderBar.qml
=====================================
@@ -228,14 +228,15 @@ T.ProgressBar {
         TapHandler {
             acceptedButtons: Qt.LeftButton
 
-            grabPermissions: TapHandler.CanTakeOverFromAnything
-
             gesturePolicy: TapHandler.WithinBounds
 
-            //clicked but not dragged
-            onTapped: (point, button) => {
-                fsm.pressControl(point.position.x / control.width, point.modifiers === Qt.ShiftModifier)
-                fsm.releaseControl(point.position.x / control.width, point.modifiers === Qt.ShiftModifier)
+            onPressedChanged: {
+                if (pressed) {
+                    fsm.pressControl(point.position.x / control.width, point.modifiers === Qt.ShiftModifier)
+                } else {
+                    // NOTE: Point is still valid at this point.
+                    fsm.releaseControl(point.position.x / control.width, point.modifiers === Qt.ShiftModifier)
+                }
             }
         }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7d523406931ccf618ad83c5aa8f23118de3ddf40...dfc421a56b93ce980982a9a0bc6faada2610cb9e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7d523406931ccf618ad83c5aa8f23118de3ddf40...dfc421a56b93ce980982a9a0bc6faada2610cb9e
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list