Libplasma
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
62 imagePath:
"widgets/switch"
68 x: Math.max(0, Math.min(parent.width - width, root.control.visualPosition * parent.width - (width / 2)))
70 anchors.verticalCenter: parent.verticalCenter
73 elementId: root.control.down ?
"handle-pressed" : ( (root.control.enabled && root.control.hovered) || root.control.focus ?
"handle-hover" :
"handle")
75 implicitWidth: naturalSize.width
76 implicitHeight: naturalSize.height
79 enabled: !root.control.down &&
Kirigami.Units.shortDuration > 0
83 duration:
Kirigami.Units.shortDuration
84 easing.type: Easing.InOutQuad
90 anchors.centerIn: parent
91 implicitWidth: naturalSize.width
92 implicitHeight: naturalSize.height
93 elementId:
"handle-shadow"
94 visible: enabled && !root.control.down
97 anchors.centerIn: parent
98 implicitWidth: naturalSize.width
99 implicitHeight: naturalSize.height
101 elementId:
"handle-focus"
103 opacity: root.control.visualFocus
104 Behavior on opacity {
105 enabled:
Kirigami.Units.longDuration > 0
107 duration:
Kirigami.Units.longDuration
108 easing.type: Easing.OutCubic
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 28 2025 11:50:52 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.