Fix shadowing of slide's handles and use vertical svg elements for vertical slides
REVIEW: 105269
This commit is contained in:
parent
874bbd6068
commit
7ec06767e2
@ -146,8 +146,8 @@ Item {
|
|||||||
|
|
||||||
// Plasma API
|
// Plasma API
|
||||||
property bool animated: true
|
property bool animated: true
|
||||||
property real handleWidth: grooveSvg.elementSize("horizontal-slider-handle").width
|
property real handleWidth: contents.isVertical ? grooveSvg.elementSize("vertical-slider-handle").width : grooveSvg.elementSize("horizontal-slider-handle").width
|
||||||
property real handleHeight: grooveSvg.elementSize("horizontal-slider-handle").height
|
property real handleHeight: contents.isVertical ? grooveSvg.elementSize("vertical-slider-handle").height : grooveSvg.elementSize("horizontal-slider-handle").height
|
||||||
|
|
||||||
// Convenience API
|
// Convenience API
|
||||||
property bool isVertical: orientation == Qt.Vertical
|
property bool isVertical: orientation == Qt.Vertical
|
||||||
@ -210,11 +210,13 @@ Item {
|
|||||||
Private.RoundShadow {
|
Private.RoundShadow {
|
||||||
id: shadow
|
id: shadow
|
||||||
imagePath: "widgets/slider"
|
imagePath: "widgets/slider"
|
||||||
focusElement: "horizontal-slider-focus"
|
focusElement: contents.isVertical ? "vertical-slider-focus" : "horizontal-slider-focus"
|
||||||
hoverElement: "horizontal-slider-hover"
|
hoverElement: contents.isVertical ? "vertical-slider-hover" : "horizontal-slider-hover"
|
||||||
shadowElement: "horizontal-slider-shadow"
|
shadowElement: contents.isVertical ? "vertical-slider-shadow" : "horizontal-slider-shadow"
|
||||||
state: slider.activeFocus ? "focus" : (mouseArea.containsMouse ? "hover" : "shadow")
|
state: slider.activeFocus ? "focus" : (mouseArea.containsMouse ? "hover" : "shadow")
|
||||||
anchors.fill: handle
|
anchors.fill: handle
|
||||||
|
//We rotate the handle below, we need to rotate the shadow back as well
|
||||||
|
rotation: contents.isVertical ? 90 : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaCore.SvgItem {
|
PlasmaCore.SvgItem {
|
||||||
@ -226,8 +228,10 @@ Item {
|
|||||||
}
|
}
|
||||||
width: contents.handleWidth
|
width: contents.handleWidth
|
||||||
height: contents.handleHeight
|
height: contents.handleHeight
|
||||||
|
//Rotate the handle back for vertical slider so all the handles have the same shadow effect
|
||||||
|
rotation: contents.isVertical ? 90 : 0
|
||||||
svg: PlasmaCore.Svg { imagePath: "widgets/slider" }
|
svg: PlasmaCore.Svg { imagePath: "widgets/slider" }
|
||||||
elementId: "horizontal-slider-handle"
|
elementId: contents.isVertical ? "vertical-slider-handle" : "horizontal-slider-handle"
|
||||||
|
|
||||||
Behavior on x {
|
Behavior on x {
|
||||||
id: behavior
|
id: behavior
|
||||||
|
Loading…
Reference in New Issue
Block a user