[vlc-commits] qml: SliderBar handle mouse drag better

Fatih Uzunoglu git at videolan.org
Mon Nov 16 10:04:18 CET 2020


vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Wed Aug 19 19:14:59 2020 +0300| [0ed7299a8e3056bb5b36cbff905588e0290460ae] | committer: Pierre Lamot

qml: SliderBar handle mouse drag better

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

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

 modules/gui/qt/player/qml/SliderBar.qml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/player/qml/SliderBar.qml b/modules/gui/qt/player/qml/SliderBar.qml
index 9168a0bc23..24a723ac58 100644
--- a/modules/gui/qt/player/qml/SliderBar.qml
+++ b/modules/gui/qt/player/qml/SliderBar.qml
@@ -99,7 +99,10 @@ Slider {
             }
             onReleased: control._isHold = false
             onPositionChanged: function (event) {
-                if (pressed && (event.x <= control.width)) {
+                if (pressed) {
+                    if (event.x < 0) event.x = 0;
+                    else if (event.x > control.width) event.x = control.width;
+
                     control.value = event.x / control.width
                     player.position = control.value
                 }



More information about the vlc-commits mailing list