feat(wallet)_: add loadingIndicatorSize and mirror properties to StatusButton

- Added `loadingIndicatorSize` property to `StatusBaseButton` to allow customization of loading indicator size.
- Introduced `mirror` property in `StatusIcon` to support icon mirroring.

resolves: #1365
This commit is contained in:
belalshehab 2024-07-03 02:26:36 +03:00 committed by Belal Shehab
parent 8a3d24bc3a
commit d0f0537c56
2 changed files with 11 additions and 2 deletions

View File

@ -55,6 +55,9 @@ Button {
property int type: StatusBaseButton.Type.Normal
property int textPosition: StatusBaseButton.TextPosition.Right
// use Size.Small as default value to not change old behavior which had default size of 20x20
property int loadingIndicatorSize: StatusBaseButton.Size.Small
property bool isRoundIcon: false
QtObject {
@ -69,8 +72,10 @@ Button {
}
readonly property bool iconOnly: root.display === AbstractButton.IconOnly || root.text === ""
readonly property int iconSize: {
switch(root.size) {
readonly property int iconSize: mapIconSize(root.size)
function mapIconSize(buttonSize) {
switch(buttonSize) {
case StatusBaseButton.Size.Tiny:
return 16
case StatusBaseButton.Size.Small:
@ -152,6 +157,7 @@ Button {
StatusIcon {
icon: root.icon.name
rotation: root.asset.rotation
mirror: root.asset.mirror
opacity: !root.loading && root.icon.name !== "" && root.display !== AbstractButton.TextOnly
color: root.icon.color
}
@ -221,6 +227,8 @@ Button {
Loader {
anchors.centerIn: parent
active: root.loading
width: d.mapIconSize(root.loadingIndicatorSize)
height: width
sourceComponent: StatusLoadingIndicator {
color: d.textColor
}

View File

@ -13,6 +13,7 @@ QtObject {
property color hoverColor
property color disabledColor
property int rotation
property bool mirror
property bool isLetterIdenticon
property bool useAcronymForLetterIdenticon: true