From 3c52f4941f4274a51587dd5ca71ade7b17964dcc Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 27 Jul 2017 12:48:53 +0200 Subject: intoduce Kube.Checkbox --- framework/qml/CheckBox.qml | 49 ++++++++++++++++++++++++++++++++++++++++++++++ framework/qml/Icons.qml | 1 + framework/qmldir | 1 + 3 files changed, 51 insertions(+) create mode 100644 framework/qml/CheckBox.qml (limited to 'framework') diff --git a/framework/qml/CheckBox.qml b/framework/qml/CheckBox.qml new file mode 100644 index 00000000..acd16783 --- /dev/null +++ b/framework/qml/CheckBox.qml @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2017 Michael Bohlender, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.7 +import QtQuick.Templates 2.0 as T +import org.kube.framework 1.0 as Kube + +T.CheckBox { + id: root + + implicitWidth: indicator.width + implicitHeight: indicator.width + + indicator: Rectangle { + width: Kube.Units.gridUnit + height: Kube.Units.gridUnit + + color: Kube.Colors.viewBackgroundColor + + border.width: 1 + border.color: Kube.Colors.buttonColor + + Kube.Icon { + anchors.centerIn: parent + + visible: root.checked + + height: Kube.Units.gridUnit + width: Kube.Units.gridUnit + + iconName: Kube.Icons.checkbox + } + } +} diff --git a/framework/qml/Icons.qml b/framework/qml/Icons.qml index 6f0a8652..3126c797 100644 --- a/framework/qml/Icons.qml +++ b/framework/qml/Icons.qml @@ -53,6 +53,7 @@ Item { property string goDown: "go-down" property string goDown_inverted: "go-down-inverted" property string goUp: "go-up" + property string checkbox: "checkbox" property string addNew: "list-add" property string remove: "kube-list-remove-inverted" diff --git a/framework/qmldir b/framework/qmldir index 93f0fc59..c8e0ae58 100644 --- a/framework/qmldir +++ b/framework/qmldir @@ -19,6 +19,7 @@ Popup 1.0 Popup.qml ProgressBar 1.0 ProgressBar.qml StatusBar 1.0 StatusBar.qml ComboBox 1.0 ComboBox.qml +CheckBox 1.0 CheckBox.qml PositiveButton 1.0 PositiveButton.qml TextButton 1.0 TextButton.qml TextField 1.0 TextField.qml -- cgit v1.2.3