fix(StatusBaseButton): Button component should keep its original width/size when it enters loading state
fixes #656
This commit is contained in:
parent
5def2102c7
commit
b4ebc520e1
|
@ -105,6 +105,17 @@ Rectangle {
|
||||||
hoverEnabled: !loading
|
hoverEnabled: !loading
|
||||||
enabled: !loading
|
enabled: !loading
|
||||||
|
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
active: loading
|
||||||
|
sourceComponent: StatusLoadingIndicator {
|
||||||
|
color: statusBaseButton.enabled ? textColor
|
||||||
|
: disabledTextColor
|
||||||
|
} // Indicator
|
||||||
|
} // Loader
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: layout
|
id: layout
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
@ -117,29 +128,20 @@ Rectangle {
|
||||||
height: statusBaseButton.icon.height
|
height: statusBaseButton.icon.height
|
||||||
icon: statusBaseButton.icon.name
|
icon: statusBaseButton.icon.name
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
visible: !loading && statusBaseButton.icon.name !== ""
|
opacity: !loading && statusBaseButton.icon.name !== ""
|
||||||
|
visible: statusBaseButton.icon.name !== ""
|
||||||
color: statusBaseButton.enabled ? textColor
|
color: statusBaseButton.enabled ? textColor
|
||||||
: disabledTextColor
|
: disabledTextColor
|
||||||
} // Icon
|
} // Icon
|
||||||
StatusBaseText {
|
StatusBaseText {
|
||||||
id: label
|
id: label
|
||||||
visible: !loading
|
opacity: !loading
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
font.pixelSize: size === StatusBaseButton.Size.Large ? 15 : 13 // by design
|
font.pixelSize: size === StatusBaseButton.Size.Large ? 15 : 13 // by design
|
||||||
|
|
||||||
color: statusBaseButton.enabled ? textColor
|
color: statusBaseButton.enabled ? textColor
|
||||||
: disabledTextColor
|
: disabledTextColor
|
||||||
} // Text
|
} // Text
|
||||||
|
|
||||||
Loader {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
active: loading
|
|
||||||
visible: loading
|
|
||||||
sourceComponent: StatusLoadingIndicator {
|
|
||||||
color: statusBaseButton.enabled ? textColor
|
|
||||||
: disabledTextColor
|
|
||||||
} // Indicator
|
|
||||||
} // Loader
|
|
||||||
} // Ro
|
} // Ro
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue