diff --git a/declarativeimports/plasmacomponents/DualStateButton.qml b/declarativeimports/plasmacomponents/DualStateButton.qml index c0feb4a6f..968c5cb48 100644 --- a/declarativeimports/plasmacomponents/DualStateButton.qml +++ b/declarativeimports/plasmacomponents/DualStateButton.qml @@ -36,15 +36,20 @@ Item { width: surface.width + label.paintedWidth height: surface.height + opacity: dualButton.enabled ? 1.0 : 0.5 // XXX: temporary solution function entered() { - shadow.opacity = 0; - hover.opacity = 1; + if (dualButton.enabled) { + shadow.opacity = 0; + hover.opacity = 1; + } } function released() { - dualButton.checked = !dualButton.checked; - dualButton.clicked(); + if (dualButton.enabled) { + dualButton.checked = !dualButton.checked; + dualButton.clicked(); + } } Keys.onSpacePressed: entered(); diff --git a/declarativeimports/test/gallery/CheckableButtons.qml b/declarativeimports/test/gallery/CheckableButtons.qml index 023f3e075..fee6032b4 100644 --- a/declarativeimports/test/gallery/CheckableButtons.qml +++ b/declarativeimports/test/gallery/CheckableButtons.qml @@ -46,7 +46,8 @@ Column { PlasmaComponents.CheckBox { height: 30 - text: "Check Box 2" + text: "Disabled" + enabled: false } PlasmaComponents.CheckBox {