From 856b001d731cd47a8f529c22d386969a81a4e44b Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 27 Apr 2012 15:14:43 +0200 Subject: [PATCH] respect svg size for handle size --- declarativeimports/plasmacomponents/qml/Slider.qml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/declarativeimports/plasmacomponents/qml/Slider.qml b/declarativeimports/plasmacomponents/qml/Slider.qml index 967eb4b16..d8b66dbdd 100644 --- a/declarativeimports/plasmacomponents/qml/Slider.qml +++ b/declarativeimports/plasmacomponents/qml/Slider.qml @@ -69,9 +69,6 @@ Plasma Properties: alias inverted: This property holds if the slider visualizations has an inverted direction. The default value is false. - - real handleSize: - This property holds the size of the Slider's handle. **/ import QtQuick 1.0 @@ -149,7 +146,8 @@ Item { // Plasma API property bool animated: true - property real handleSize: theme.defaultFont.mSize.height*1.3 + property real handleWidth: grooveSvg.elementSize("horizontal-slider-handle").width + property real handleHeight: grooveSvg.elementSize("horizontal-slider-handle").height // Convenience API property bool isVertical: orientation == Qt.Vertical @@ -217,8 +215,8 @@ Item { anchors { verticalCenter: groove.verticalCenter } - width: contents.handleSize - height: contents.handleSize + width: contents.handleWidth + height: contents.handleHeight svg: PlasmaCore.Svg { imagePath: "widgets/slider" } elementId: "horizontal-slider-handle" @@ -260,7 +258,7 @@ Item { // Debounce the press: a press event inside the handler will not // change its position, the user needs to drag it. if (Math.abs(newX - fakeHandle.x) > handle.width / 2) { - range.position = newX + range.position = newX - handle.width / 2 } slider.forceActiveFocus()