fix(@chat): Fixed blurry emojis

This commit is contained in:
Igor Sirotin 2022-05-13 18:55:42 +03:00 committed by Iuri Matias
parent 244dda1b7d
commit 993499567b
6 changed files with 14 additions and 17 deletions

@ -1 +1 @@
Subproject commit eb96e5e08d2efe75b80da733b729f6e4ffce6451
Subproject commit 99a3aa522fb17958f82f6ecef5d7067109731f67

View File

@ -28,8 +28,7 @@ Item {
SVGImage {
width: root.size
height: root.size
source: StatusQUtils.Emoji.parse(modelData).match('src="(.*\\.svg)')[1]
source: Style.emoji(StatusQUtils.Emoji.iconId(modelData))
}
}
}

View File

@ -247,7 +247,7 @@ Popup {
delegate: SVGImage {
width: 22
height: 22
source: Style.emoji("72x72/" + modelData)
source: Style.emoji(modelData)
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
@ -268,7 +268,7 @@ Popup {
anchors.right: parent.right
anchors.rightMargin: emojiHeader.headerMargin
visible: !skinToneEmoji.expandSkinColorOptions
source: Style.emoji("72x72/1f590" + ((localAccountSensitiveSettings.skinColor !== "" && visible) ? ("-" + localAccountSensitiveSettings.skinColor) : ""))
source: Style.emoji("1f590" + ((localAccountSensitiveSettings.skinColor !== "" && visible) ? ("-" + localAccountSensitiveSettings.skinColor) : ""))
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent

View File

@ -92,8 +92,7 @@ Item {
SVGImage {
width: emojiSection.imageWidth
height: emojiSection.imageWidth
//TODO EMOJI SVG?
source: "qrc:/StatusQ/src/assets/twemoji/svg/" + modelData.filename + "?22x22"
source: Style.emoji(modelData.filename)
MouseArea {
cursorShape: Qt.PointingHandCursor

View File

@ -112,17 +112,16 @@ Item {
}
text: {
if(contentType === Constants.messageContentType.stickerType) return "";
if (contentType === Constants.messageContentType.stickerType) return "";
let msg = Utils.linkifyAndXSS(message);
if(isEmoji) {
return StatusQUtils.Emoji.parse(msg, StatusQUtils.Emoji.size.middle);
} else {
if(isEdited){
if (isEmoji)
return StatusQUtils.Emoji.parse(msg, StatusQUtils.Emoji.size.middle, StatusQUtils.Emoji.format.png);
if (isEdited) {
let index = msg.endsWith("code>") ? msg.length : msg.length - 4
return Utils.getMessageWithStyle(StatusQUtils.Emoji.parse(msg.slice(0, index) + Constants.editLabel + msg.slice(index)), isCurrentUser, hoveredLink)
}
return Utils.getMessageWithStyle(StatusQUtils.Emoji.parse(msg), isCurrentUser, hoveredLink)
}
}
}

View File

@ -47,7 +47,7 @@ QtObject {
return assetPath + "icons/" + name + ".svg";
}
function emoji(name) {
return "qrc:/StatusQ/src/assets/twemoji/" + name + ".png";
return "qrc:/StatusQ/src/assets/twemoji/svg/" + name + ".svg";
}
function lottie(name) {
return assetPath + "lottie/" + name + ".json";