[vlc-devel] [PATCH 2/2] qml: fix undefined sizing of the volume widget making it invisible

Pierre Lamot pierre at videolabs.io
Tue Jun 18 16:08:50 CEST 2019


---
 modules/gui/qt/qml/player/VolumeWidget.qml | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/qml/player/VolumeWidget.qml b/modules/gui/qt/qml/player/VolumeWidget.qml
index 4ba213e5f1..d823eb23d8 100644
--- a/modules/gui/qt/qml/player/VolumeWidget.qml
+++ b/modules/gui/qt/qml/player/VolumeWidget.qml
@@ -81,10 +81,13 @@ FocusScope{
             }
 
             background: Rectangle {
+                id: sliderBg
                 x: volControl.leftPadding
                 y: volControl.topPadding + volControl.availableHeight / 2 - height / 2
                 implicitWidth: parent.width
                 implicitHeight: 4 * VLCStyle.scale
+                height: implicitHeight
+                width: volControl.availableWidth
                 radius: 4 * VLCStyle.scale
                 color: VLCStyle.colors.volsliderbg
 
@@ -114,14 +117,14 @@ FocusScope{
                 }
                 Rectangle {
                     id: filled
-                    width: volControl.visualPosition * parent.width
+                    width: volControl.visualPosition * sliderBg.width
                     height: parent.height
                     radius: 4 * VLCStyle.scale
                     color: VLCStyle.colors.buttonText
                     layer.enabled: (volControl.hovered || volControl.activeFocus)
                     layer.effect: LinearGradient {
                         start: Qt.point(0, 0)
-                        end: Qt.point(volControl.width, 0)
+                        end: Qt.point(sliderBg.width, 0)
                         gradient: Gradient {
                             GradientStop { position: 0.30; color: VLCStyle.colors.volbelowmid }
                             GradientStop { position: 0.80; color: VLCStyle.colors.volabovemid }
-- 
2.17.1



More information about the vlc-devel mailing list