2014-07-11 14:19:13 +00:00
|
|
|
import QtQuick 2.0
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: checkBox
|
|
|
|
property alias text: label.text
|
2014-07-22 14:55:25 +00:00
|
|
|
property string checkedIcon
|
|
|
|
property string uncheckedIcon
|
2014-07-11 14:19:13 +00:00
|
|
|
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
|
2014-07-17 11:14:27 +00:00
|
|
|
//radius: 4
|
2014-07-11 14:19:13 +00:00
|
|
|
y: 0
|
|
|
|
color: "#DBDBDB"
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.left: parent.left
|
|
|
|
height: parent.height - 1
|
|
|
|
width: 25
|
2014-07-17 11:14:27 +00:00
|
|
|
//radius: 4
|
2014-07-11 14:19:13 +00:00
|
|
|
y: 1
|
|
|
|
color: "#FFFFFF"
|
|
|
|
|
|
|
|
Image {
|
|
|
|
anchors.centerIn: parent
|
2014-07-22 14:55:25 +00:00
|
|
|
source: checkBox.checked ? checkBox.checkedIcon :
|
|
|
|
checkBox.uncheckedIcon
|
2014-07-11 14:19:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|