feat(StatusLetterIdenticon): simplify names of properties

Closes: #14439
This commit is contained in:
Michał Cieślak 2024-05-17 19:45:27 +02:00 committed by Michał
parent a153279e77
commit b764446568
7 changed files with 9 additions and 9 deletions

View File

@ -21,10 +21,10 @@ Rectangle {
//
// characterLen is ignored
property bool useAcronymForLetterIdenticon: false
property bool strictBackgroundColor: !useAcronymForLetterIdenticon
property bool backgroundWithAlpha: useAcronymForLetterIdenticon
color: {
if (root.strictBackgroundColor)
if (!root.backgroundWithAlpha)
return root.letterIdenticonColor
return Qt.rgba(root.letterIdenticonColor.r,
@ -57,7 +57,7 @@ Rectangle {
font.weight: Font.Bold
font.pixelSize: root.letterSize
color: {
if (!root.strictBackgroundColor)
if (root.backgroundWithAlpha)
return root.letterIdenticonColor
return d.luminance(root.letterIdenticonColor) > 0.5 ? Qt.rgba(0, 0, 0, 0.5) : Qt.rgba(1, 1, 1, 0.7)

View File

@ -120,7 +120,7 @@ Loader {
letterSize: root.asset.letterSize
charactersLen: root.asset.charactersLen
useAcronymForLetterIdenticon: root.asset.useAcronymForLetterIdenticon
strictBackgroundColor: root.asset.useLetterIdenticonStrictBgColor
backgroundWithAlpha: root.asset.letterIdenticonBgWithAlpha
}
}

View File

@ -16,7 +16,7 @@ QtObject {
property bool isLetterIdenticon
property bool useAcronymForLetterIdenticon: true
property bool useLetterIdenticonStrictBgColor: true
property bool letterIdenticonBgWithAlpha: false
property int letterSize: emoji ? 11 : (charactersLen == 1 ? _oneLetterSize : _twoLettersSize)
property int charactersLen: 1

View File

@ -63,7 +63,7 @@ StatusListItem {
height: 40
color: Utils.getColorForId(root.colorId)
isLetterIdenticon: true
useLetterIdenticonStrictBgColor: false
letterIdenticonBgWithAlpha: true
}
statusListItemIcon.hoverEnabled: true

View File

@ -562,7 +562,7 @@ StatusModal {
emoji: model.emoji
color: model.color
isLetterIdenticon: !model.icon
useLetterIdenticonStrictBgColor: model.type !== AddEditSavedAddressPopup.CardType.SavedAddress
letterIdenticonBgWithAlpha: model.type === AddEditSavedAddressPopup.CardType.SavedAddress
charactersLen: 2
}
}

View File

@ -233,7 +233,7 @@ StatusModal {
emoji: root.selectedAccount.emoji
charactersLen: 1
isLetterIdenticon: root.selectedAccount.name && !root.selectedAccount.emoji
useLetterIdenticonStrictBgColor: !root.selectedAccount.name || root.selectedAccount.emoji
letterIdenticonBgWithAlpha: root.selectedAccount.name && !root.selectedAccount.emoji
}
}
}

View File

@ -55,7 +55,7 @@ StatusDialog {
asset {
color: Utils.getColorForId(root.colorId)
isLetterIdenticon: true
useLetterIdenticonStrictBgColor: false
letterIdenticonBgWithAlpha: true
}
}
}