[vlc-commits] qt: fix volume slider control

Romain Vimont git at videolan.org
Mon Apr 12 08:14:55 UTC 2021


vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Wed Apr  7 18:27:05 2021 +0200| [c3ed0e7a4fc3c517570ba543f0ddcbc98c4ecaa5] | committer: Pierre Lamot

qt: fix volume slider control

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.

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

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

 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: {



More information about the vlc-commits mailing list