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
+15 -4
View File
@@ -4,6 +4,8 @@ import "." // QTBUG-34418, singletons require explicit import to load qmldir fil
CheckBox { CheckBox {
checkState: Qt.Checked
tristate: false
hoverEnabled: true hoverEnabled: true
spacing: 12 spacing: 12
@@ -14,12 +16,21 @@ CheckBox {
y: parent.height / 2 - height / 2 y: parent.height / 2 - height / 2
color: parent.enabled ? (parent.down ? "#e0e0e0" : "#ffffff") : "#a0a0a0" color: parent.enabled ? (parent.down ? "#e0e0e0" : "#ffffff") : "#a0a0a0"
border.width: 0 border.width: 0
Path {
startX: 0
startY: 0
PathLine {
x: 40
y: 40
}
}
Image { Image {
width: 38 width: 28
height: 38 height: 28
x: (parent.width - width) / 2 x: (parent.width - width) / 2
y: (parent.height - height) / 2 y: (parent.height - height) / 2
source: "image://default/check/#2c435d" source: "check.svg"
sourceSize.width: width sourceSize.width: width
sourceSize.height: height sourceSize.height: height
visible: parent.parent.checked visible: parent.parent.checked
@@ -36,7 +47,7 @@ CheckBox {
background: Rectangle { background: Rectangle {
color: "#2c435d" color: "#2c435d"
opacity: parent.activeFocus ? 1.0 : 0.0 opacity: parent.activeFocus ? 1.0 : 0
} }
onHoveredChanged: { 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