summaryrefslogtreecommitdiffstats
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
parent5e9d12d1d9793afe0099fc8b68eeae1b8bbe8098 (diff)
downloadkube-22a0b53d76f5f229591861450f85e5ded5d8f3fc.tar.gz
kube-22a0b53d76f5f229591861450f85e5ded5d8f3fc.zip
inital switch control
-rw-r--r--framework/qml/Switch.qml35
-rw-r--r--framework/qmldir1
2 files changed, 36 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}
diff --git a/framework/qmldir b/framework/qmldir
index 461bd653..691dbba8 100644
--- a/framework/qmldir
+++ b/framework/qmldir
@@ -21,6 +21,7 @@ ProgressBar 1.0 ProgressBar.qml
21StatusBar 1.0 StatusBar.qml 21StatusBar 1.0 StatusBar.qml
22ComboBox 1.0 ComboBox.qml 22ComboBox 1.0 ComboBox.qml
23CheckBox 1.0 CheckBox.qml 23CheckBox 1.0 CheckBox.qml
24Switch 1.0 as Switch.qml
24PositiveButton 1.0 PositiveButton.qml 25PositiveButton 1.0 PositiveButton.qml
25TextButton 1.0 TextButton.qml 26TextButton 1.0 TextButton.qml
26TextField 1.0 TextField.qml 27TextField 1.0 TextField.qml