[PlasmaComponents3] Show ToolButton focus effect and omit shadow when flat
Make sure the shadow item--which includes the hover effect, if present--can be shown when the ToolButton is focused, and also always omit the shadow when the ToolButton is flat.
This commit is contained in:
parent
e7fadd1671
commit
bc4a6d06bc
@ -108,7 +108,8 @@ T.ToolButton {
|
|||||||
background: Item {
|
background: Item {
|
||||||
Private.ButtonShadow {
|
Private.ButtonShadow {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: (!control.flat || control.hovered) && (!control.pressed || !control.checked)
|
visible: (!control.flat || control.hovered || control.activeFocus) && (!control.pressed || !control.checked)
|
||||||
|
|
||||||
state: {
|
state: {
|
||||||
if (control.pressed) {
|
if (control.pressed) {
|
||||||
return "hidden"
|
return "hidden"
|
||||||
@ -117,7 +118,7 @@ T.ToolButton {
|
|||||||
} else if (control.activeFocus) {
|
} else if (control.activeFocus) {
|
||||||
return "focus"
|
return "focus"
|
||||||
} else {
|
} else {
|
||||||
return "shadow"
|
return control.flat ? "shadow" : "hidden"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user