Use twemoji.js
|
@ -257,8 +257,16 @@ Item {
|
|||
|
||||
StyledTextEdit {
|
||||
id: chatText
|
||||
text: linkify(message)
|
||||
textFormat: TextEdit.RichText
|
||||
text: {
|
||||
if(contentType === Constants.stickerType) return "";
|
||||
if (isMessage) return linkify(message);
|
||||
if(isEmoji){
|
||||
return Emoji.parse(message, "72x72");
|
||||
} else {
|
||||
return Emoji.parse(message, "26x26");
|
||||
}
|
||||
}
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: parent.chatHorizontalPadding
|
||||
anchors.right: message.length > 52 ? parent.right : undefined
|
||||
|
@ -267,12 +275,11 @@ Item {
|
|||
wrapMode: Text.Wrap
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: chatBox.chatVerticalPadding
|
||||
font.pixelSize: isEmoji ? 40 : 15
|
||||
font.pixelSize: 15
|
||||
readOnly: true
|
||||
selectByMouse: true
|
||||
color: !isCurrentUser ? Theme.black : Theme.white
|
||||
visible: contentType == Constants.messageType || isEmoji
|
||||
textFormat: TextEdit.RichText
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
|
|
@ -58,7 +58,7 @@ Rectangle {
|
|||
|
||||
StyledText {
|
||||
id: contactInfo
|
||||
text: wrapper.chatType !== Constants.chatTypePublic ? wrapper.name : "#" + wrapper.name
|
||||
text: wrapper.chatType !== Constants.chatTypePublic ? Emoji.parse(wrapper.name, "26x26") : "#" + wrapper.name
|
||||
anchors.right: contactTime.left
|
||||
anchors.rightMargin: Theme.smallPadding
|
||||
elide: Text.ElideRight
|
||||
|
@ -73,7 +73,7 @@ Rectangle {
|
|||
|
||||
StyledText {
|
||||
id: lastChatMessage
|
||||
text: lastMessage ? lastMessage.replace(/\n|\r/g, ' ') : qsTr("No messages")
|
||||
text: lastMessage ? Emoji.parse(lastMessage, "26x26").replace(/\n|\r/g, ' ') : qsTr("No messages")
|
||||
anchors.right: contactNumberChatsCircle.left
|
||||
anchors.rightMargin: Theme.smallPadding
|
||||
elide: Text.ElideRight
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
pragma Singleton
|
||||
|
||||
import QtQuick 2.13
|
||||
import "./twemoji/twemoji.js" as Twemoji
|
||||
|
||||
QtObject {
|
||||
property string base: Qt.resolvedUrl("twemoji/")
|
||||
function parse(text, size) {
|
||||
Twemoji.twemoji.base = base
|
||||
Twemoji.twemoji.ext = ".png"
|
||||
Twemoji.twemoji.size = size
|
||||
return Twemoji.twemoji.parse(text)
|
||||
}
|
||||
}
|
|
@ -7,7 +7,7 @@ QtObject {
|
|||
property QtObject fontBold: FontLoader { id: _fontBold; source: "../fonts/InterStatus/InterStatus-Bold.otf"; }
|
||||
property QtObject fontLight: FontLoader { id: _fontLight; source: "../fonts/InterStatus/InterStatus-Light.otf"; }
|
||||
property QtObject fontRegular: FontLoader { id: _fontRegular; source: "../fonts/InterStatus/InterStatus-Regular.otf"; }
|
||||
property QtObject fontEmoji: FontLoader { id: _fontEmoji; source: "../fonts/TwitterEmoji.ttf"; }
|
||||
|
||||
|
||||
readonly property color white: "#FFFFFF"
|
||||
readonly property color white2: "#FCFCFC"
|
||||
|
|
|
@ -2,4 +2,5 @@ module Theme
|
|||
singleton Theme 1.0 ./Theme.qml
|
||||
singleton Constants 1.0 ./Constants.qml
|
||||
singleton Utils 1.0 ./Utils.qml
|
||||
singleton Emoji 1.0 ./Emoji.qml
|
||||
|
||||
|
|
After Width: | Height: | Size: 1012 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 934 B |
After Width: | Height: | Size: 855 B |
After Width: | Height: | Size: 850 B |
After Width: | Height: | Size: 788 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 995 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 876 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1020 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 833 B |
After Width: | Height: | Size: 671 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 989 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 843 B |
After Width: | Height: | Size: 468 B |
After Width: | Height: | Size: 906 B |
After Width: | Height: | Size: 822 B |
After Width: | Height: | Size: 553 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 422 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 621 B |
After Width: | Height: | Size: 640 B |
After Width: | Height: | Size: 703 B |
After Width: | Height: | Size: 915 B |
After Width: | Height: | Size: 960 B |
After Width: | Height: | Size: 671 B |
After Width: | Height: | Size: 674 B |
After Width: | Height: | Size: 476 B |
After Width: | Height: | Size: 579 B |
After Width: | Height: | Size: 478 B |
After Width: | Height: | Size: 651 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 594 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 714 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 993 B |
After Width: | Height: | Size: 659 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 629 B |
After Width: | Height: | Size: 422 B |
After Width: | Height: | Size: 881 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 857 B |
After Width: | Height: | Size: 824 B |
After Width: | Height: | Size: 960 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 906 B |
After Width: | Height: | Size: 618 B |
After Width: | Height: | Size: 556 B |
After Width: | Height: | Size: 476 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 708 B |
After Width: | Height: | Size: 567 B |
After Width: | Height: | Size: 663 B |
After Width: | Height: | Size: 475 B |
After Width: | Height: | Size: 476 B |
After Width: | Height: | Size: 659 B |
After Width: | Height: | Size: 770 B |
After Width: | Height: | Size: 881 B |
After Width: | Height: | Size: 592 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 792 B |
After Width: | Height: | Size: 838 B |
After Width: | Height: | Size: 883 B |
After Width: | Height: | Size: 475 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 934 B |
After Width: | Height: | Size: 608 B |
After Width: | Height: | Size: 885 B |
After Width: | Height: | Size: 885 B |
After Width: | Height: | Size: 807 B |
After Width: | Height: | Size: 841 B |
After Width: | Height: | Size: 737 B |
After Width: | Height: | Size: 779 B |
After Width: | Height: | Size: 475 B |
After Width: | Height: | Size: 736 B |
After Width: | Height: | Size: 898 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 737 B |
After Width: | Height: | Size: 1.1 KiB |