[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 { 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"
} }
} }
} }