feat(StatusIconSetting): add emojiSize setting for icons (#579)

This commit is contained in:
Jonathan Rainville 2022-03-17 14:14:39 -04:00 committed by Michał Cieślak
parent dfad051880
commit 66b5b9d34b
6 changed files with 11 additions and 3 deletions

View File

@ -28,8 +28,9 @@ Rectangle {
width: 24
height: 24
color: Theme.palette.miscColor5
letterSize: emoji ? 14 : 15
letterSize: emoji ? 10 : 15
emoji: ""
emojiSize: Emoji.size.verySmall
charactersLen: 1
}
property int type: StatusChatListItem.Type.PublicChat

View File

@ -9,6 +9,7 @@ Rectangle {
property alias identiconText: identiconText
property string name
property string emoji
property string emojiSize
property int letterSize: 21
property int charactersLen: 1
@ -35,7 +36,7 @@ Rectangle {
if(Utils.isHtml(emoji))
return emoji
else
return Emoji.parse(emoji)
return Emoji.parse(emoji, emojiSize || undefined)
}
const shift = (root.name.charAt(0) === "#") ||

View File

@ -57,6 +57,8 @@ Control {
visible: root.icon.isLetterIdenticon
color: root.icon.color
name: root.primaryText
emoji: root.icon.emoji
emojiSize: root.icon.emojiSize
}
StatusBaseText {
font.weight: Font.Medium

View File

@ -85,6 +85,7 @@ Loader {
color: statusSmartIdenticon.icon.color
name: statusSmartIdenticon.name
emoji: statusSmartIdenticon.icon.emoji
emojiSize: statusSmartIdenticon.icon.emojiSize
letterSize: statusSmartIdenticon.icon.letterSize
identiconText.color: statusSmartIdenticon.icon.textColor
charactersLen: statusSmartIdenticon.icon.charactersLen

View File

@ -16,5 +16,6 @@ QtObject {
property int letterSize
property int charactersLen
property string emoji
property string emojiSize
property StatusIconBackgroundSettings background: StatusIconBackgroundSettings {}
}

View File

@ -8,9 +8,11 @@ import "./emojiList.js" as EmojiJSON
QtObject {
readonly property var size: {
"veryBig": "86x86",
"big": "72x72",
"middle": "32x32",
"small": "18x18"
"small": "18x18",
"verySmall": "16x16"
}
property string base: Qt.resolvedUrl("../../../assets/twemoji/")
function parse(text, renderSize = size.small) {