9import QtQuick.Templates as T
10import org.kde.ksvg as KSvg
11import org.kde.kirigami as Kirigami
12import "private" as Private
17 required
property T.AbstractButton control
19 implicitWidth: inactive.implicitWidth
20 implicitHeight: Math.max(inactive.implicitHeight, button.implicitHeight)
22 layer.enabled: opacity < 1
23 opacity: control.enabled ? 1 : 0.6
27 imagePath:
"widgets/switch"
29 colorSet: root.control.Kirigami.Theme.colorSet
39 verticalCenter: parent.verticalCenter
41 implicitHeight: switchSvg.hasElement(
"hint-bar-size")
42 ? switchSvg.elementSize(
"hint-bar-size").height
43 : button.implicitHeight
44 implicitWidth: switchSvg.hasElement(
"hint-bar-size")
45 ? switchSvg.elementSize(
"hint-bar-size").width
46 : root.implicitHeight * 2
47 imagePath:
"widgets/switch"
54 bottom: inactive.bottom
57 imagePath:
"widgets/switch"
63 x: Math.max(0, Math.min(parent.width - width, root.control.visualPosition * parent.width - (width / 2)))
65 anchors.verticalCenter: parent.verticalCenter
68 elementId: root.control.down ?
"handle-pressed" : (root.control.hovered || root.control.focus ?
"handle-hover" :
"handle")
70 implicitWidth: naturalSize.width
71 implicitHeight: naturalSize.height
74 enabled: !root.control.down &&
Kirigami.Units.shortDuration > 0
78 duration:
Kirigami.Units.shortDuration
79 easing.type: Easing.InOutQuad
85 anchors.centerIn: parent
86 implicitWidth: naturalSize.width
87 implicitHeight: naturalSize.height
88 elementId:
"handle-shadow"
89 visible: enabled && !root.control.down
92 anchors.centerIn: parent
93 implicitWidth: naturalSize.width
94 implicitHeight: naturalSize.height
96 elementId:
"handle-focus"
98 opacity: root.control.visualFocus
100 enabled:
Kirigami.Units.longDuration > 0
102 duration:
Kirigami.Units.longDuration
103 easing.type: Easing.OutCubic
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:06:24 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.