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 Michał Cieślak
parent adbae92730
commit 9dd65224bf
1 changed files with 1 additions and 4 deletions

View File

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