better alignment

This commit is contained in:
Marco Martin 2013-05-08 21:58:07 +02:00
parent b860d42cb1
commit 572163bae3
2 changed files with 15 additions and 4 deletions

View File

@ -54,11 +54,13 @@ PlasmaCore.FrameSvgItem {
} }
SliderHandle { SliderHandle {
id: minimumLengthHandle id: minimumLengthHandle
offset: panel.offset
graphicElementName: "minslider" graphicElementName: "minslider"
onValueChanged: panel.minimumLength = value onValueChanged: panel.minimumLength = value
} }
SliderHandle { SliderHandle {
id: maximumLengthHandle id: maximumLengthHandle
offset: panel.offset
graphicElementName: "maxslider" graphicElementName: "maxslider"
onValueChanged: panel.maximumLength = value onValueChanged: panel.maximumLength = value
} }

View File

@ -33,12 +33,21 @@ PlasmaCore.SvgItem {
property int value property int value
property string graphicElementName property string graphicElementName
property int offset: 0
onValueChanged: { onValueChanged: {
if (panel.location == 5 || panel.location == 6) { if (panel.location == 5 || panel.location == 6) {
y = value y = value + offset - root.height/2
} else { } else {
x = value x = value + offset - root.width/2
}
}
onOffsetChanged: {
if (panel.location == 5 || panel.location == 6) {
y = value + offset - root.height/2
} else {
x = value + offset - root.width/2
} }
} }
@ -50,9 +59,9 @@ PlasmaCore.SvgItem {
anchors.fill: parent anchors.fill: parent
onPositionChanged: { onPositionChanged: {
if (panel.location == 5 || panel.location == 6) { if (panel.location == 5 || panel.location == 6) {
root.value = parent.y root.value = parent.y - offset + root.height/2
} else { } else {
root.value = parent.x root.value = parent.x - offset + root.width/2
} }
} }
} }