[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:
Nate Graham 2020-07-14 03:50:31 +00:00
parent e7fadd1671
commit bc4a6d06bc

View File

@ -108,7 +108,8 @@ T.ToolButton {
background: Item {
Private.ButtonShadow {
anchors.fill: parent
visible: (!control.flat || control.hovered) && (!control.pressed || !control.checked)
visible: (!control.flat || control.hovered || control.activeFocus) && (!control.pressed || !control.checked)
state: {
if (control.pressed) {
return "hidden"
@ -117,7 +118,7 @@ T.ToolButton {
} else if (control.activeFocus) {
return "focus"
} else {
return "shadow"
return control.flat ? "shadow" : "hidden"
}
}
}