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 { SVGImage {
width: root.size width: root.size
height: root.size height: root.size
source: Style.emoji(StatusQUtils.Emoji.iconId(modelData))
source: StatusQUtils.Emoji.parse(modelData).match('src="(.*\\.svg)')[1]
} }
} }
} }

View File

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

View File

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

View File

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

View File

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