1
0
Fork 0
flightgear/src/GUI/qml/Checkbox.qml
James Turner 4c2e52c2dc Standardise QtQuick version to 2.4
Will fix an issue reported on the forum where a 2.7 dep crept it.
2018-03-19 08:22:11 +00:00

45 lines
996 B
QML

import QtQuick 2.4
Item {
property bool checked: false
property alias label: label.text
implicitWidth: checkBox.width + label.width + 16
implicitHeight: label.height
Rectangle {
id: checkBox
width: 18
height: 18
border.color: mouseArea.containsMouse ? "#68A6E1" : "#9f9f9f"
border.width: 1
anchors.left: parent.left
anchors.leftMargin: 8
anchors.verticalCenter: parent.verticalCenter
Rectangle {
width: 12
height: 12
anchors.centerIn: parent
id: checkMark
color: "#9f9f9f"
visible: checked
}
}
Text {
id: label
anchors.left: checkBox.right
anchors.leftMargin: 8
anchors.verticalCenter: parent.verticalCenter
}
MouseArea {
anchors.fill: parent
id: mouseArea
hoverEnabled: true
onClicked: {
checked = !checked
}
}
}