improve layouting for switch style

work/spdx
Michail Vourlakos 4 years ago
parent 05aeae0ee1
commit 2fb98156d6

@ -33,25 +33,40 @@ QtQuickControlStyle.SwitchStyle {
PlasmaCore.FrameSvgItem { PlasmaCore.FrameSvgItem {
id: button id: button
anchors.fill: parent
imagePath: "widgets/button" imagePath: "widgets/button"
prefix: "normal" prefix: "normal"
anchors.fill: parent
} }
} }
groove: PlasmaCore.FrameSvgItem { groove: Item {
imagePath: "widgets/slider"
prefix: "groove"
implicitHeight: theme.mSize(theme.defaultFont).height implicitHeight: theme.mSize(theme.defaultFont).height
implicitWidth: height * 2 implicitWidth: height * 2
PlasmaCore.FrameSvgItem {
anchors.fill: parent
implicitHeight: parent.implicitHeight
implicitWidth: parent.implicitWidth
imagePath: "widgets/slider"
prefix: "groove"
opacity: control.checked ? 0 : 1
visible: opacity > 0
Behavior on opacity {
PropertyAnimation { duration: units.shortDuration * 2 }
}
}
PlasmaCore.FrameSvgItem { PlasmaCore.FrameSvgItem {
id: highlight id: highlight
anchors.fill: parent
implicitHeight: parent.implicitHeight
implicitWidth: parent.implicitWidth
imagePath: "widgets/slider" imagePath: "widgets/slider"
prefix: "groove-highlight" prefix: "groove-highlight"
anchors.fill: parent
opacity: control.checked ? 1 : 0 opacity: control.checked ? 1 : 0
visible: opacity > 0
Behavior on opacity { Behavior on opacity {
PropertyAnimation { duration: units.shortDuration * 2 } PropertyAnimation { duration: units.shortDuration * 2 }
} }

Loading…
Cancel
Save