use an active look for the on switch and the progress part of the slider

This commit is contained in:
Marco Martin 2011-10-11 14:26:51 +02:00
parent 93a8858617
commit 2ae8e31d77
2 changed files with 33 additions and 5 deletions

View File

@ -113,17 +113,33 @@ Item {
positionAtMaximum: contents.width - handle.width / 2
}
PlasmaCore.SvgItem {
PlasmaCore.Svg {
id: grooveSvg
imagePath: "widgets/frame"
}
PlasmaCore.FrameSvgItem {
id: groove
imagePath: "widgets/frame"
prefix: "sunken"
//FIXME: frameSvg should have a minimumSize attribute, could be added to kdelibs 4.7(maybe just the qml binding is enough)?
height: grooveSvg.elementSize("sunken-topleft").height + grooveSvg.elementSize("sunken-bottomleft").height
anchors {
left: parent.left
right: parent.right
verticalCenter: parent.verticalCenter
}
height: 3
svg: PlasmaCore.Svg { imagePath: "widgets/slider" }
elementId: "horizontal-slider-line"
}
PlasmaCore.FrameSvgItem {
id: highlight
imagePath: "widgets/frame"
prefix: "sunken-active"
height: groove.height
width: range.position
anchors {
left: parent.left
verticalCenter: parent.verticalCenter
}
visible: range.position > 0 && slider.enabled
}
PlasmaCore.SvgItem {

View File

@ -35,6 +35,18 @@ DualStateButton {
visible: false
}
PlasmaCore.FrameSvgItem {
id: highlight
imagePath: "widgets/frame"
prefix: "sunken-active"
anchors.fill: parent
opacity: checked ? 1 : 0
Behavior on opacity {
PropertyAnimation { duration: 100 }
}
}
PlasmaCore.FrameSvgItem {
imagePath: "widgets/button"
prefix: "shadow"