[SliderStyle] Allow providing a "hint-handle-size" element

This hints the actual size of the handle, excluding any padding and shadows
and allows for the handle to touch the outermost border of the rail underneath.

Differential Revision: https://phabricator.kde.org/D4762
This commit is contained in:
Kai Uwe Broulik 2017-02-28 10:22:36 +01:00
parent 916bcbf6c0
commit 6b70fd983b
2 changed files with 7 additions and 4 deletions

View File

@ -40,12 +40,13 @@ QtQuickControlStyle.SliderStyle {
}
handle: Item {
width: handle.naturalSize.width
height: handle.naturalSize.height
width: grooveSvg.hasElement("hint-handle-size") ? grooveSvg.elementSize("hint-handle-size").width : handle.width
height: grooveSvg.hasElement("hint-handle-size") ? grooveSvg.elementSize("hint-handle-size").height : handle.height
//keep this opaque to not show half highlight beneath
Private.RoundShadow {
id: shadow
anchors.fill: parent
anchors.fill: handle
imagePath: "widgets/slider"
focusElement: "horizontal-slider-focus"
hoverElement: "horizontal-slider-hover"
@ -54,7 +55,9 @@ QtQuickControlStyle.SliderStyle {
}
PlasmaCore.SvgItem {
id: handle
anchors.fill: parent
anchors.centerIn: parent
width: naturalSize.width
height: naturalSize.height
svg: grooveSvg
elementId: "horizontal-slider-handle"
}