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 {
id: minimumLengthHandle
offset: panel.offset
graphicElementName: "minslider"
onValueChanged: panel.minimumLength = value
}
SliderHandle {
id: maximumLengthHandle
offset: panel.offset
graphicElementName: "maxslider"
onValueChanged: panel.maximumLength = value
}

View File

@ -33,12 +33,21 @@ PlasmaCore.SvgItem {
property int value
property string graphicElementName
property int offset: 0
onValueChanged: {
if (panel.location == 5 || panel.location == 6) {
y = value
y = value + offset - root.height/2
} 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
onPositionChanged: {
if (panel.location == 5 || panel.location == 6) {
root.value = parent.y
root.value = parent.y - offset + root.height/2
} else {
root.value = parent.x
root.value = parent.x - offset + root.width/2
}
}
}