From 7a5342e97067cffb316fd57e20f1ca326a0854ee Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 24 Oct 2014 18:12:36 +0200 Subject: [PATCH] fix paint and size hints Change-Id: Icb42635f4d4d2f15fb6cd51805f3e0e0906c34a2 --- .../plasmacomponents/qml/ProgressBar.qml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/declarativeimports/plasmacomponents/qml/ProgressBar.qml b/src/declarativeimports/plasmacomponents/qml/ProgressBar.qml index 2e19c004f..69b6df11b 100644 --- a/src/declarativeimports/plasmacomponents/qml/ProgressBar.qml +++ b/src/declarativeimports/plasmacomponents/qml/ProgressBar.qml @@ -83,8 +83,8 @@ Item { id: background anchors.centerIn: parent - width: _isVertical ? barSvg.elementSize("hint-bar-size").width * Math.floor(units.devicePixelRatio) : parent.width - height: _isVertical ? parent.height : barSvg.elementSize("hint-bar-size").height * Math.floor(units.devicePixelRatio) + width: _isVertical ? barSvg.implicitWidth * Math.floor(units.devicePixelRatio) : parent.width + height: _isVertical ? parent.height : barSvg.implicitHeight * Math.floor(units.devicePixelRatio) imagePath: barSvg.imagePath prefix: "bar-inactive" @@ -110,6 +110,12 @@ Item { PlasmaCore.Svg { id: barSvg imagePath: orientation == Qt.Vertical ? "widgets/bar_meter_vertical" : "widgets/bar_meter_horizontal" + property int preferredWidth + property int preferredHeight + onRepaintNeeded: { + preferredWidth = barSvg.elementSize("hint-bar-size").width + preferredHeight = barSvg.elementSize("hint-bar-size").height + } } }