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,16 +36,21 @@ Item {
|
|||||||
|
|
||||||
width: surface.width + label.paintedWidth
|
width: surface.width + label.paintedWidth
|
||||||
height: surface.height
|
height: surface.height
|
||||||
|
opacity: dualButton.enabled ? 1.0 : 0.5 // XXX: temporary solution
|
||||||
|
|
||||||
function entered() {
|
function entered() {
|
||||||
|
if (dualButton.enabled) {
|
||||||
shadow.opacity = 0;
|
shadow.opacity = 0;
|
||||||
hover.opacity = 1;
|
hover.opacity = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function released() {
|
function released() {
|
||||||
|
if (dualButton.enabled) {
|
||||||
dualButton.checked = !dualButton.checked;
|
dualButton.checked = !dualButton.checked;
|
||||||
dualButton.clicked();
|
dualButton.clicked();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Keys.onSpacePressed: entered();
|
Keys.onSpacePressed: entered();
|
||||||
Keys.onReturnPressed: entered();
|
Keys.onReturnPressed: entered();
|
||||||
|
@ -46,7 +46,8 @@ Column {
|
|||||||
|
|
||||||
PlasmaComponents.CheckBox {
|
PlasmaComponents.CheckBox {
|
||||||
height: 30
|
height: 30
|
||||||
text: "Check Box 2"
|
text: "Disabled"
|
||||||
|
enabled: false
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaComponents.CheckBox {
|
PlasmaComponents.CheckBox {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user