From 572163bae3c053da9f7aef6fbda6830d2f9e2583 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 8 May 2013 21:58:07 +0200 Subject: [PATCH] better alignment --- .../configuration/panelconfiguration/Ruler.qml | 2 ++ .../panelconfiguration/SliderHandle.qml | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml index 0d0d62bc5..2f6460694 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/Ruler.qml @@ -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 } diff --git a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml index c7fd63ab6..79e389d96 100644 --- a/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml +++ b/src/shell/qmlpackages/desktop/contents/configuration/panelconfiguration/SliderHandle.qml @@ -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 } } }