fix paint and size hints

Change-Id: Icb42635f4d4d2f15fb6cd51805f3e0e0906c34a2
This commit is contained in:
Marco Martin 2014-10-24 18:12:36 +02:00
parent 2b07624173
commit 7a5342e970

View File

@ -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
}
}
}