fix(StatusBaseButton): After loading, button keeps loader width, so the button size is bigger

When button changed from loading to their normal shape it kept the width of the loader as it was visible in the row component.

It has been added a binding between loader `visible` property and root `loading` property that fixes the issue with the width.

Also, removed some `break` leftovers.

Fixes #5606 --> https://github.com/status-im/status-desktop/issues/5606
This commit is contained in:
Noelia 2022-05-05 16:03:54 +02:00 committed by r4bbit.eth
parent baf5948c90
commit 3bdfc3e528
1 changed files with 1 additions and 4 deletions

View File

@ -40,11 +40,9 @@ Rectangle {
return 5
case StatusBaseButton.Size.Small:
return 10
break;
case StatusBaseButton.Size.Large:
default:
return 11
break;
}
}
property real defaultBottomPadding: {
@ -53,11 +51,9 @@ Rectangle {
return 5
case StatusBaseButton.Size.Small:
return 10
break;
case StatusBaseButton.Size.Large:
default:
return 11
break;
}
}
@ -138,6 +134,7 @@ Rectangle {
Loader {
anchors.verticalCenter: parent.verticalCenter
active: loading
visible: loading
sourceComponent: StatusLoadingIndicator {
color: statusBaseButton.enabled ? textColor
: disabledTextColor