diff --git a/ui/app/AppLayouts/Chat/ChatColumn/ChatButtons.qml b/ui/app/AppLayouts/Chat/ChatColumn/ChatButtons.qml index ca27d20197..d267cf5437 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/ChatButtons.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/ChatButtons.qml @@ -40,10 +40,9 @@ Item { property bool hovered: false id: emojiIconContainer - visible: txtData.length == 0 width: emojiIcon.width + chatButtonsContainer.iconPadding * 2 height: emojiIcon.height + chatButtonsContainer.iconPadding * 2 - anchors.right: stickerIconContainer.left + anchors.right: txtData.length == 0 ? stickerIconContainer.left : chatSendBtn.left anchors.rightMargin: Style.current.padding - chatButtonsContainer.iconPadding * 2 anchors.verticalCenter: parent.verticalCenter radius: Style.current.radius diff --git a/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml b/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml index 90cd365eb8..f4eacb8189 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml @@ -33,7 +33,6 @@ Rectangle { anchors.fill: parent ScrollView { - anchors.fill: parent Layout.fillWidth: true Layout.fillHeight: true @@ -66,7 +65,7 @@ Rectangle { Layout.minimumWidth: 30 + Style.current.padding Layout.maximumWidth: 200 addToChat: function (text) { - txtData.append(text) + txtData.insert(txtData.length, text) } } } diff --git a/ui/app/AppLayouts/Chat/ContactsColumn/Channel.qml b/ui/app/AppLayouts/Chat/ContactsColumn/Channel.qml index 3820d3be79..704ee08800 100644 --- a/ui/app/AppLayouts/Chat/ContactsColumn/Channel.qml +++ b/ui/app/AppLayouts/Chat/ContactsColumn/Channel.qml @@ -74,6 +74,7 @@ Rectangle { StyledText { id: lastChatMessage text: lastMessage ? Emoji.parse(lastMessage, "26x26").replace(/\n|\r/g, ' ') : qsTr("No messages") + clip: true // This is needed because emojis don't ellide correctly anchors.right: contactNumberChatsCircle.left anchors.rightMargin: Style.current.smallPadding elide: Text.ElideRight diff --git a/ui/app/AppLayouts/Chat/components/EmojiPopup.qml b/ui/app/AppLayouts/Chat/components/EmojiPopup.qml index 01531cf364..553eea980c 100644 --- a/ui/app/AppLayouts/Chat/components/EmojiPopup.qml +++ b/ui/app/AppLayouts/Chat/components/EmojiPopup.qml @@ -81,8 +81,20 @@ Popup { cursorShape: Qt.PointingHandCursor anchors.fill: parent onClicked: { - const encodedIcon = Emoji.fromCodePoint(filename.replace(".svg", "")) - popup.addToChat(encodedIcon) + const extenstionIndex = filename.lastIndexOf('.'); + let iconCodePoint = filename + if (extenstionIndex > -1) { + iconCodePoint = iconCodePoint.substring(0, extenstionIndex) + } + + // Split the filename to get all the parts and then encode them from hex to utf8 + const splitCodePoint = iconCodePoint.split('-') + let codePointParts = [] + splitCodePoint.forEach(function (codePoint) { + codePointParts.push(`0x${codePoint}`) + }) + const encodedIcon = String.fromCodePoint(...codePointParts); + popup.addToChat(encodedIcon + ' ') // Adding a space because otherwise, some emojis would fuse since it's just an emoji is just a string popup.close() } }