[vlc-devel] [PATCH 2/3] qt: fix volume slider control

Romain Vimont rom1v at videolabs.io
Wed Apr 7 16:27:05 UTC 2021


When changing the volume slider with the mouse, the new value considered
the width of the complete component instead of the relevant visual part.

As a consequence, the slider did not follow the mouse correctly.
---
 modules/gui/qt/player/qml/VolumeWidget.qml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/qt/player/qml/VolumeWidget.qml b/modules/gui/qt/player/qml/VolumeWidget.qml
index 67ac2ab58c..177ca6caae 100644
--- a/modules/gui/qt/player/qml/VolumeWidget.qml
+++ b/modules/gui/qt/player/qml/VolumeWidget.qml
@@ -218,7 +218,7 @@ FocusScope{
                         }
 
                         if(pressed)
-                            volControl.value = volControl.maxvolpos * event.x / (volControl.width)
+                            volControl.value = volControl.maxvolpos * event.x / sliderMouseArea.width
                     }
 
                     onWheel: {
-- 
2.31.0



More information about the vlc-devel mailing list