Add enabled/disable support for CheckBoxes, RadioButtons and Switches plasma components
- The current disabled CheckBoxes, RadioButtons and Switches, have less opacity when disabled instead of custom graphics. Needs to be defined if this is the expected behaviour. Signed-off-by: Daker Fernandes Pinheiro <dakerfp@gmail.com>
This commit is contained in:
parent
487d79bce3
commit
4ff2523d13
@ -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();
|
||||
|
@ -46,7 +46,8 @@ Column {
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
height: 30
|
||||
text: "Check Box 2"
|
||||
text: "Disabled"
|
||||
enabled: false
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
|
Loading…
Reference in New Issue
Block a user