blob: 6ed10ecd8ba72e13310713c4b69795ef95290d10 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
import QtQuick 2.8
import QtQuick.Templates 2.2 as T
import org.kube.framework 1.0 as Kube
T.Switch {
id: root
implicitWidth: indicator.width
implicitHeight: indicator.height
Keys.onReturnPressed: root.toggle()
indicator: Item {
height: Kube.Units.gridUnit
width: Kube.Units.gridUnit * 2
Rectangle {
width: parent.width
height: parent.height
color: root.checked ? Kube.Colors.highlightColor : Kube.Colors.buttonColor
radius: 2
}
Rectangle {
height: parent.height
width: height
x: root.visualPosition * Kube.Units.gridUnit
radius: 2
color: Kube.Colors.viewBackgroundColor
border {
width: root.hovered || root.visualFocus ? 2 : 1
color: root.hovered || root.visualFocus ? Kube.Colors.highlightColor : Kube.Colors.buttonColor
}
}
}
}
|