fix(@desktop/chat): Show text for messages with gif image

Close #5434
This commit is contained in:
mishkarogachev 2022-05-11 13:16:52 +03:00 committed by Iuri Matias
parent 06f7f1668d
commit 7b45ce60a7
2 changed files with 3 additions and 10 deletions

View File

@ -738,11 +738,11 @@ Rectangle {
x: parent.width - width - Style.current.halfPadding x: parent.width - width - Style.current.halfPadding
y: -height y: -height
gifSelected: function (event, url) { gifSelected: function (event, url) {
messageInputField.text = url messageInputField.text += "\n" + url
control.sendMessage(event) control.sendMessage(event)
gifBtn.highlighted = false gifBtn.highlighted = false
messageInputField.forceActiveFocus() messageInputField.forceActiveFocus()
if(control.closeGifPopupAfterSelection) if (control.closeGifPopupAfterSelection)
gifPopup.close() gifPopup.close()
} }
onClosed: { onClosed: {

View File

@ -501,14 +501,7 @@ Item {
ChatTextView { ChatTextView {
id: chatText id: chatText
readonly property int leftPadding: chatImage.anchors.leftMargin + chatImage.width + chatHorizontalPadding readonly property int leftPadding: chatImage.anchors.leftMargin + chatImage.width + chatHorizontalPadding
visible: { visible: isText || isEmoji || isImage
const urls = linkUrls.split(" ")
if (urls.length === 1 && Utils.hasImageExtension(urls[0]) && localAccountSensitiveSettings.displayChatImages) {
return false
}
return isText || isEmoji
}
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: isEmoji ? 2 : 0 anchors.topMargin: isEmoji ? 2 : 0