From 0abfab467486bbf4f02703b15ca94e66eb53004e Mon Sep 17 00:00:00 2001 From: Alexandra Betouni <31625338+alexandraB99@users.noreply.github.com> Date: Wed, 9 Mar 2022 00:06:31 +0200 Subject: [PATCH] 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. --- ui/StatusQ/src/StatusQ/Components/StatusLetterIdenticon.qml | 4 +++- ui/StatusQ/src/StatusQ/Components/StatusSmartIdenticon.qml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/StatusQ/src/StatusQ/Components/StatusLetterIdenticon.qml b/ui/StatusQ/src/StatusQ/Components/StatusLetterIdenticon.qml index acd4f0adf9..a31336b8f6 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusLetterIdenticon.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusLetterIdenticon.qml @@ -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 diff --git a/ui/StatusQ/src/StatusQ/Components/StatusSmartIdenticon.qml b/ui/StatusQ/src/StatusQ/Components/StatusSmartIdenticon.qml index 91d614ddfe..ecef87ccb3 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusSmartIdenticon.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusSmartIdenticon.qml @@ -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 } }