From 4ec02e7b1dff65d6c44b3d1c55a978f9ae709c58 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 28 Aug 2014 13:12:04 +0200 Subject: [PATCH] style handle and groove --- .../qml/styles/SliderStyle.qml | 46 +++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/src/declarativeimports/plasmacomponents/qml/styles/SliderStyle.qml b/src/declarativeimports/plasmacomponents/qml/styles/SliderStyle.qml index 1ccffd76b..846df8bf5 100644 --- a/src/declarativeimports/plasmacomponents/qml/styles/SliderStyle.qml +++ b/src/declarativeimports/plasmacomponents/qml/styles/SliderStyle.qml @@ -28,13 +28,53 @@ import org.kde.plasma.components 2.0 as PlasmaComponents import "../private" as Private QtQuickControlStyle.SliderStyle { - id: styleitem + id: styleItem + property Item handleItem padding { top: 0 ; left: 0 ; right: 0 ; bottom: 0 } - // handle: + PlasmaCore.Svg { + id: grooveSvg + imagePath: "widgets/slider" + } + handle: Item { + width: handle.naturalSize.width + height: handle.naturalSize.height + Private.RoundShadow { + id: shadow + anchors.fill: parent + imagePath: "widgets/slider" + focusElement: "horizontal-slider-focus" + hoverElement: "horizontal-slider-hover" + shadowElement: "horizontal-slider-shadow" + state: control.activeFocus ? "focus" : (control.hovered ? "hover" : "shadow") + } + PlasmaCore.SvgItem { + id: handle + anchors.fill: parent + svg: grooveSvg + elementId: "horizontal-slider-handle" + } + } + - // groove: + groove: PlasmaCore.FrameSvgItem { + id: groove + imagePath: "widgets/slider" + prefix: "groove" + PlasmaCore.FrameSvgItem { + id: highlight + imagePath: "widgets/slider" + prefix: "groove-highlight" + height: groove.height + + width: styleData.handlePosition + x: 0 + anchors.verticalCenter: parent.verticalCenter + + visible: value > 0 && slider.enabled + } + } // tickmarks: