fix(StatusBaseButton): keep `MouseArea` enabled when in `loading` state
`StatusBaseButton` comes with a `MouseArea` that is disabled when the button is set to being disabled. Prior to this commit it's *also* disabled when the button is in `loading` state. This makes sense because a button that is in `loading` state shouldn't not emit any click signals or trigger hover indications. There's a scenario though in which we want render a tooltip on top of the button which is in `loading` state. For the tooltip to show, the `MouseArea` of the button needs to be enabled. Hence, this commit adjust `StatusBaseButton`'s behaviour to *not* disable the `MouseArea` when it's `loading`. Mouse events are already prevented via the `loading` flag. So the only thing left to do is to ensure the button doesn't trigger any hover indication when in `loading` state.
This commit is contained in:
parent
fc10a0d43d
commit
504053a6bf
|
@ -89,7 +89,7 @@ Rectangle {
|
|||
|
||||
color: {
|
||||
if (statusBaseButton.enabled)
|
||||
return sensor.containsMouse || highlighted ? hoverColor
|
||||
return !statusButton.loading && (sensor.containsMouse || highlighted) ? hoverColor
|
||||
: normalColor;
|
||||
return disaledColor
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ Rectangle {
|
|||
: Qt.PointingHandCursor
|
||||
|
||||
hoverEnabled: true
|
||||
enabled: !loading && statusBaseButton.enabled
|
||||
enabled: statusBaseButton.enabled
|
||||
|
||||
Loader {
|
||||
anchors.centerIn: parent
|
||||
|
|
Loading…
Reference in New Issue