feat(StatusLetterIdenticon): Added charCount property in StatusLetterIdenticon

For desktop task #4956 the letter identicon displayed inside
the StatusSmartIdenticon should be of 2 characters and not 1.
This commit is contained in:
Alexandra Betouni 2022-03-09 00:06:31 +02:00 committed by Michał Cieślak
parent 6b7a332d61
commit 0abfab4674
2 changed files with 5 additions and 1 deletions

View File

@ -10,6 +10,7 @@ Rectangle {
property string name
property string emoji
property int letterSize: 21
property int charCount: 1
color: Theme.palette.miscColor5
width: 40
@ -22,9 +23,10 @@ Rectangle {
if (emoji) {
return Emoji.parse(emoji)
}
return ((statusLetterIdenticon.name.charAt(0) === "#")
return (((statusLetterIdenticon.name.charAt(0) === "#")
|| (statusLetterIdenticon.name.charAt(0) === "@") ?
statusLetterIdenticon.name.charAt(1) : statusLetterIdenticon.name.charAt(0)).toUpperCase()
+ ((charCount === 2) ? statusLetterIdenticon.name.charAt(1) : ""))
}
font.weight: Font.Bold
font.pixelSize: statusLetterIdenticon.letterSize

View File

@ -7,6 +7,7 @@ Loader {
id: statusSmartIdenticon
property string name: ""
property int charCount: 1
property string emoji: ""
property int dZ: 100
@ -86,6 +87,7 @@ Loader {
name: statusSmartIdenticon.name
emoji: statusSmartIdenticon.emoji
letterSize: statusSmartIdenticon.icon.letterSize
charCount: statusSmartIdenticon.charCount
}
}