From 22a0b53d76f5f229591861450f85e5ded5d8f3fc Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Wed, 13 Sep 2017 11:35:57 +0200 Subject: inital switch control --- framework/qml/Switch.qml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 framework/qml/Switch.qml (limited to 'framework/qml') 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 @@ +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 + + indicator: Item { + height: Kube.Units.gridUnit + width: Kube.Units.gridUnit * 2 + + Rectangle { + width: parent.width + height: parent.height + radius: 5 + color: root.checked ? Kube.Colors.highlightColor : Kube.Colors.buttonColor + } + + Rectangle { + height: parent.height + width: height + + x: root.visualPosition * Kube.Units.gridUnit + + radius: 5 + color: Kube.Colors.viewBackgroundColor + border.width: 1 + border.color: Kube.Colors.buttonColor + } + } +} -- cgit v1.2.3