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:
Pascal Precht 2022-09-07 13:26:16 +02:00 committed by Michał Cieślak
parent 25bc2fe566
commit 6e10b57c79
1 changed files with 2 additions and 2 deletions

View File

@ -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