support evil tristates

This commit is contained in:
Marco Martin 2014-08-20 10:56:50 +02:00
parent df637bf5bb
commit ff775e3ad7

View File

@ -30,7 +30,6 @@ QtQuickControlStyle.CheckBoxStyle {
label: PlasmaComponents.Label { label: PlasmaComponents.Label {
text: control.text text: control.text
} }
//Not needed?
background: Item {} background: Item {}
spacing: units.smallSpacing spacing: units.smallSpacing
@ -48,7 +47,16 @@ QtQuickControlStyle.CheckBoxStyle {
imagePath: "widgets/checkmarks" imagePath: "widgets/checkmarks"
} }
elementId: "checkbox" elementId: "checkbox"
opacity: control.checked ? 1 : 0 opacity: {
switch (control.checkedState) {
case Qt.Checked:
return 1;
case Qt.PartiallyChecked:
return 0.5;
default:
return 0;
}
}
anchors { anchors {
fill: parent fill: parent
margins: parent.margins.left/2 margins: parent.margins.left/2