summaryrefslogtreecommitdiffstats
path: root/framework/qml/Switch.qml
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2017-09-13 11:35:57 +0200
committerMichael Bohlender <michael.bohlender@kdemail.net>2017-09-13 11:35:57 +0200
commit22a0b53d76f5f229591861450f85e5ded5d8f3fc (patch)
tree9edd7cb9a86507e7ba596f6991e972c436108343 /framework/qml/Switch.qml
parent5e9d12d1d9793afe0099fc8b68eeae1b8bbe8098 (diff)
downloadkube-22a0b53d76f5f229591861450f85e5ded5d8f3fc.tar.gz
kube-22a0b53d76f5f229591861450f85e5ded5d8f3fc.zip
inital switch control
Diffstat (limited to 'framework/qml/Switch.qml')
-rw-r--r--framework/qml/Switch.qml35
1 files changed, 35 insertions, 0 deletions
diff --git a/framework/qml/Switch.qml b/framework/qml/Switch.qml
new file mode 100644
index 00000000..2803c84a
--- /dev/null
+++ b/framework/qml/Switch.qml
@@ -0,0 +1,35 @@
1import QtQuick 2.8
2import QtQuick.Templates 2.2 as T
3import org.kube.framework 1.0 as Kube
4
5
6T.Switch {
7 id: root
8
9 implicitWidth: indicator.width
10 implicitHeight: indicator.height
11
12 indicator: Item {
13 height: Kube.Units.gridUnit
14 width: Kube.Units.gridUnit * 2
15
16 Rectangle {
17 width: parent.width
18 height: parent.height
19 radius: 5
20 color: root.checked ? Kube.Colors.highlightColor : Kube.Colors.buttonColor
21 }
22
23 Rectangle {
24 height: parent.height
25 width: height
26
27 x: root.visualPosition * Kube.Units.gridUnit
28
29 radius: 5
30 color: Kube.Colors.viewBackgroundColor
31 border.width: 1
32 border.color: Kube.Colors.buttonColor
33 }
34 }
35}