mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-18 02:21:17 +00:00
fix(StatusBaseButton): Button component should keep its original width/size when it enters loading state
fixes #656
This commit is contained in:
parent
b79c1f149b
commit
80ac7d22b9
@ -105,6 +105,17 @@ Rectangle {
|
||||
hoverEnabled: !loading
|
||||
enabled: !loading
|
||||
|
||||
|
||||
Loader {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
active: loading
|
||||
sourceComponent: StatusLoadingIndicator {
|
||||
color: statusBaseButton.enabled ? textColor
|
||||
: disabledTextColor
|
||||
} // Indicator
|
||||
} // Loader
|
||||
|
||||
Row {
|
||||
id: layout
|
||||
anchors.left: parent.left
|
||||
@ -117,29 +128,20 @@ Rectangle {
|
||||
height: statusBaseButton.icon.height
|
||||
icon: statusBaseButton.icon.name
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: !loading && statusBaseButton.icon.name !== ""
|
||||
opacity: !loading && statusBaseButton.icon.name !== ""
|
||||
visible: statusBaseButton.icon.name !== ""
|
||||
color: statusBaseButton.enabled ? textColor
|
||||
: disabledTextColor
|
||||
} // Icon
|
||||
StatusBaseText {
|
||||
id: label
|
||||
visible: !loading
|
||||
opacity: !loading
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font.pixelSize: size === StatusBaseButton.Size.Large ? 15 : 13 // by design
|
||||
|
||||
color: statusBaseButton.enabled ? textColor
|
||||
: disabledTextColor
|
||||
} // Text
|
||||
|
||||
Loader {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
active: loading
|
||||
visible: loading
|
||||
sourceComponent: StatusLoadingIndicator {
|
||||
color: statusBaseButton.enabled ? textColor
|
||||
: disabledTextColor
|
||||
} // Indicator
|
||||
} // Loader
|
||||
} // Ro
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user