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:
parent
6b7a332d61
commit
0abfab4674
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue