mirror of
https://github.com/monero-project/monero-gui
synced 2024-12-27 00:53:43 +01:00
57 lines
1.2 KiB
QML
57 lines
1.2 KiB
QML
import QtQuick 2.0
|
|
|
|
Item {
|
|
id: checkBox
|
|
property alias text: label.text
|
|
property string checkedIcon
|
|
property string uncheckedIcon
|
|
property bool checked: false
|
|
signal clicked()
|
|
height: 25
|
|
width: label.x + label.width
|
|
clip: true
|
|
|
|
Rectangle {
|
|
anchors.left: parent.left
|
|
height: parent.height - 1
|
|
width: 25
|
|
//radius: 4
|
|
y: 0
|
|
color: "#DBDBDB"
|
|
}
|
|
|
|
Rectangle {
|
|
anchors.left: parent.left
|
|
height: parent.height - 1
|
|
width: 25
|
|
//radius: 4
|
|
y: 1
|
|
color: "#FFFFFF"
|
|
|
|
Image {
|
|
anchors.centerIn: parent
|
|
source: checkBox.checked ? checkBox.checkedIcon :
|
|
checkBox.uncheckedIcon
|
|
}
|
|
}
|
|
|
|
Text {
|
|
id: label
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
anchors.left: parent.left
|
|
anchors.leftMargin: 25 + 12
|
|
font.family: "Arial"
|
|
font.pixelSize: 14
|
|
font.letterSpacing: -1
|
|
color: "#525252"
|
|
}
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
onClicked: {
|
|
checkBox.checked = !checkBox.checked
|
|
checkBox.clicked()
|
|
}
|
|
}
|
|
}
|