fix highdpi mode for slider and progressbar

progressbar looks like still needs some serious work
This commit is contained in:
Marco Martin 2014-03-07 17:58:46 +01:00
parent a3c4e95bb8
commit 50b5c62d81
2 changed files with 21 additions and 15 deletions

View File

@ -62,7 +62,7 @@ Item {
property int orientation: Qt.Horizontal
width: 100
height: 20
height: 20 * Math.max(1.0, Math.floor(units.devicePixelRatio))
opacity: enabled ? 1.0 : 0.5
PlasmaComponents.RangeModel {
@ -112,7 +112,9 @@ Item {
backgroundPixmapItem.pixmap = backgroundFrameSvg.framePixmap()
}
}
PlasmaCore.FrameSvg {
PlasmaCore.SvgItem {
visible: false
svg: PlasmaCore.FrameSvg {
id: barFrameSvg
Component.onCompleted: {
barFrameSvg.setImagePath("widgets/bar_meter_horizontal")
@ -120,7 +122,10 @@ Item {
resizeTimer.restart()
}
}
PlasmaCore.FrameSvg {
}
PlasmaCore.SvgItem {
visible: false
svg: PlasmaCore.FrameSvg {
id: backgroundFrameSvg
Component.onCompleted: {
backgroundFrameSvg.setImagePath("widgets/bar_meter_horizontal")
@ -128,6 +133,7 @@ Item {
resizeTimer.restart()
}
}
}
QPixmapItem {
id: backgroundPixmapItem
anchors.fill: parent

View File

@ -193,7 +193,7 @@ Item {
imagePath: "widgets/slider"
prefix: "groove"
//FIXME: frameSvg should have a minimumSize attribute, could be added to kdelibs 4.7(maybe just the qml binding is enough)?
height: grooveSvg.elementSize("groove-topleft").height + grooveSvg.elementSize("groove-bottomleft").height
height: margins.top + margins.bottom
anchors {
left: parent.left
right: parent.right
@ -244,7 +244,7 @@ Item {
height: contents.handleHeight
//Rotate the handle back for vertical slider so all the handles have the same shadow effect
rotation: contents.isVertical ? 90 : 0
svg: PlasmaCore.Svg { imagePath: "widgets/slider" }
svg: grooveSvg
elementId: contents.isVertical ? "vertical-slider-handle" : "horizontal-slider-handle"
Behavior on x {