feat(@desktop/chat): Hide chat text when the link is only an image
fixes #3366
This commit is contained in:
parent
95a3b63adb
commit
6f2dab2e29
|
@ -11,7 +11,6 @@ Item {
|
||||||
property alias textField: chatText
|
property alias textField: chatText
|
||||||
|
|
||||||
id: root
|
id: root
|
||||||
visible: isText || isEmoji
|
|
||||||
z: 51
|
z: 51
|
||||||
|
|
||||||
implicitHeight: visible ? (showMoreLoader.active ? childrenRect.height - 10 : chatText.height) : 0
|
implicitHeight: visible ? (showMoreLoader.active ? childrenRect.height - 10 : chatText.height) : 0
|
||||||
|
|
|
@ -286,8 +286,17 @@ Item {
|
||||||
visible: !isEdit
|
visible: !isEdit
|
||||||
|
|
||||||
ChatText {
|
ChatText {
|
||||||
readonly property int leftPadding: chatImage.anchors.leftMargin + chatImage.width + root.chatHorizontalPadding
|
|
||||||
id: chatText
|
id: chatText
|
||||||
|
readonly property int leftPadding: chatImage.anchors.leftMargin + chatImage.width + root.chatHorizontalPadding
|
||||||
|
visible: {
|
||||||
|
const urls = root.linkUrls.split(" ")
|
||||||
|
if (urls.length === 1 && Utils.hasImageExtension(urls[0]) && appSettings.displayChatImages) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return isText || isEmoji
|
||||||
|
}
|
||||||
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: isEmoji ? 2 : 0
|
anchors.topMargin: isEmoji ? 2 : 0
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|
Loading…
Reference in New Issue