use external checkbox image

This commit is contained in:
Robin Appelman
2018-03-20 20:47:24 +01:00
parent df7948293d
commit e77b2bf658
3 changed files with 21 additions and 8 deletions
+1
View File
@@ -0,0 +1 @@
*.qmlc
+19 -8
View File
@@ -4,22 +4,33 @@ import "." // QTBUG-34418, singletons require explicit import to load qmldir fil
CheckBox {
hoverEnabled: true
spacing: 12
checkState: Qt.Checked
tristate: false
hoverEnabled: true
spacing: 12
indicator: Rectangle {
implicitWidth: 28
implicitHeight: 28
x: parent.leftPadding
y: parent.height / 2 - height / 2
color: parent.enabled ? (parent.down ? "#e0e0e0" : "#ffffff") : "#a0a0a0"
border.width: 0
color: parent.enabled ? (parent.down ? "#e0e0e0" : "#ffffff") : "#a0a0a0"
border.width: 0
Path {
startX: 0
startY: 0
PathLine {
x: 40
y: 40
}
}
Image {
width: 38
height: 38
width: 28
height: 28
x: (parent.width - width) / 2
y: (parent.height - height) / 2
source: "image://default/check/#2c435d"
source: "check.svg"
sourceSize.width: width
sourceSize.height: height
visible: parent.parent.checked
@@ -36,7 +47,7 @@ CheckBox {
background: Rectangle {
color: "#2c435d"
opacity: parent.activeFocus ? 1.0 : 0.0
opacity: parent.activeFocus ? 1.0 : 0
}
onHoveredChanged: {
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="270" height="270"><path d="M30 180l60 60L240 30" stroke="#000" stroke-width="30" fill="none"/></svg>

After

Width:  |  Height:  |  Size: 147 B