[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: activate event filtering after the initial event in VolumeWidget

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Nov 24 08:29:19 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
fc2d8b1f by Fatih Uzunoglu at 2024-11-24T08:14:23+00:00
qml: activate event filtering after the initial event in VolumeWidget

- - - - -
48db6607 by Fatih Uzunoglu at 2024-11-24T08:14:23+00:00
qml: activate event filtering after the initial event in SliderBar

- - - - -


2 changed files:

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


Changes:

=====================================
modules/gui/qt/player/qml/SliderBar.qml
=====================================
@@ -249,6 +249,8 @@ T.ProgressBar {
             dragThreshold: 0
             grabPermissions: PointerHandler.CanTakeOverFromAnything
 
+            property bool filterEvents: false
+
             function moveControl() {
                 fsm.moveControl(dragHandler.centroid.position.x / control.width,
                                 dragHandler.centroid.modifiers === Qt.ShiftModifier)
@@ -256,6 +258,7 @@ T.ProgressBar {
 
             onActiveChanged: {
                 if (active) {
+                    filterEvents = false
                     fsm.pressControl(centroid.position.x / control.width, centroid.modifiers === Qt.ShiftModifier)
                 } else {
                     fsm.releaseControl( centroid.position.x / control.width, centroid.modifiers === Qt.ShiftModifier)
@@ -264,7 +267,12 @@ T.ProgressBar {
 
             onCentroidChanged: {
                 // FIXME: Qt 6.5 use xAxis.onActiveValueChanged in the DragHandler
-                Qt.callLater(dragHandler.moveControl)
+                if (filterEvents) {
+                    Qt.callLater(dragHandler.moveControl)
+                } else {
+                    dragHandler.moveControl()
+                    filterEvents = true
+                }
             }
         }
     }


=====================================
modules/gui/qt/player/qml/controlbarcontrols/VolumeWidget.qml
=====================================
@@ -109,6 +109,8 @@ T.Pane {
 
             property bool _keyPressed: false
 
+            property bool filterEvents: false
+
             color: root.sliderColor
 
             from: 0
@@ -209,7 +211,12 @@ T.Pane {
                     return
 
                 if (!volControl._inhibitPlayerVolumeUpdate) {
-                    Qt.callLater(volControl._adjustPlayerVolume)
+                    if (filterEvents) {
+                        Qt.callLater(volControl._adjustPlayerVolume)
+                    } else {
+                        volControl._adjustPlayerVolume()
+                        filterEvents = true
+                    }
                 }
             }
 
@@ -269,6 +276,7 @@ T.Pane {
                         return
                     }
 
+                    volControl.filterEvents = false
                     adjustVolume(mouse)
                 }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/13c44ed411eccfbb0386cedf01f3e0f75d346cd9...48db6607dd741cf66a97db2bf793193a9d9083e7

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/13c44ed411eccfbb0386cedf01f3e0f75d346cd9...48db6607dd741cf66a97db2bf793193a9d9083e7
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