From c37ba24f7b52baa36ec07e8d605f9356a7717d5c Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 30 Sep 2020 14:01:20 -0400 Subject: [PATCH] fix: fix padding around stickers in compact mode --- .../MessageComponents/CompactMessage.qml | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/CompactMessage.qml b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/CompactMessage.qml index 6fd8dd046c..cc20c28502 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/CompactMessage.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/CompactMessage.qml @@ -74,27 +74,36 @@ Item { } } - Rectangle { - id: stickerContainer - visible: contentType === Constants.stickerType - color: Style.current.transparent - border.color: Style.current.grey - border.width: 1 - radius: 16 - width: stickerId.width - height: stickerId.height + Loader { + id: stickerLoader + active: contentType === Constants.stickerType anchors.left: chatText.left anchors.top: chatName.visible ? chatName.bottom : parent.top anchors.topMargin: this.visible && chatName.visible ? chatTextItem.chatVerticalPadding : 0 - Sticker { - id: stickerId - visible: stickerContainer.visible + sourceComponent: Component { + Rectangle { + id: stickerContainer + color: Style.current.transparent + border.color: Style.current.grey + border.width: 1 + radius: 16 + width: stickerId.width + 2 * chatTextItem.chatVerticalPadding + height: stickerId.height + 2 * chatTextItem.chatVerticalPadding + + Sticker { + id: stickerId + anchors.top: parent.top + anchors.topMargin: chatTextItem.chatVerticalPadding + anchors.left: parent.left + anchors.leftMargin: chatTextItem.chatVerticalPadding + } + } } } MessageMouseArea { - anchors.fill: stickerContainer.visible ? stickerContainer : chatText + anchors.fill: stickerLoader.active ? stickerLoader : chatText } // TODO show date for not the first messsage (on hover maybe)