37 lines
792 B
QML
37 lines
792 B
QML
import QtQuick
|
|
import "."
|
|
|
|
// 18x18 square checkbox with a 10x10 solid core when checked, per
|
|
// DESIGN.md's Checkboxes spec.
|
|
Item {
|
|
id: box
|
|
|
|
// Controlled component - see ToggleSwitch.qml.
|
|
property bool checked: false
|
|
signal toggled()
|
|
|
|
implicitWidth: 18
|
|
implicitHeight: 18
|
|
|
|
Rectangle {
|
|
anchors.fill: parent
|
|
color: Theme.colors.surface
|
|
border.width: Theme.geometry.borderWidth
|
|
border.color: Theme.colors.crust
|
|
|
|
Rectangle {
|
|
width: 10
|
|
height: 10
|
|
anchors.centerIn: parent
|
|
color: Theme.colors.primary
|
|
visible: box.checked
|
|
}
|
|
}
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
cursorShape: Qt.PointingHandCursor
|
|
onClicked: box.toggled()
|
|
}
|
|
}
|