[vlc-devel] [PATCH 13/21] qml: SliderBar handle mouse drag better
Fatih Uzunoglu
fuzun54 at outlook.com
Sat Nov 7 17:53:32 CET 2020
---
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
}
--
2.25.1
More information about the vlc-devel
mailing list