fix highdpi mode for slider and progressbar
progressbar looks like still needs some serious work
This commit is contained in:
parent
a3c4e95bb8
commit
50b5c62d81
@ -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,20 +112,26 @@ Item {
|
||||
backgroundPixmapItem.pixmap = backgroundFrameSvg.framePixmap()
|
||||
}
|
||||
}
|
||||
PlasmaCore.FrameSvg {
|
||||
id: barFrameSvg
|
||||
Component.onCompleted: {
|
||||
barFrameSvg.setImagePath("widgets/bar_meter_horizontal")
|
||||
barFrameSvg.setElementPrefix("bar-active")
|
||||
resizeTimer.restart()
|
||||
PlasmaCore.SvgItem {
|
||||
visible: false
|
||||
svg: PlasmaCore.FrameSvg {
|
||||
id: barFrameSvg
|
||||
Component.onCompleted: {
|
||||
barFrameSvg.setImagePath("widgets/bar_meter_horizontal")
|
||||
barFrameSvg.setElementPrefix("bar-active")
|
||||
resizeTimer.restart()
|
||||
}
|
||||
}
|
||||
}
|
||||
PlasmaCore.FrameSvg {
|
||||
id: backgroundFrameSvg
|
||||
Component.onCompleted: {
|
||||
backgroundFrameSvg.setImagePath("widgets/bar_meter_horizontal")
|
||||
backgroundFrameSvg.setElementPrefix("bar-inactive")
|
||||
resizeTimer.restart()
|
||||
PlasmaCore.SvgItem {
|
||||
visible: false
|
||||
svg: PlasmaCore.FrameSvg {
|
||||
id: backgroundFrameSvg
|
||||
Component.onCompleted: {
|
||||
backgroundFrameSvg.setImagePath("widgets/bar_meter_horizontal")
|
||||
backgroundFrameSvg.setElementPrefix("bar-inactive")
|
||||
resizeTimer.restart()
|
||||
}
|
||||
}
|
||||
}
|
||||
QPixmapItem {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user