diff --git a/ui/app/AppLayouts/Chat/views/ChatMessagesView.qml b/ui/app/AppLayouts/Chat/views/ChatMessagesView.qml index 3ca78ec41a..4805628de1 100644 --- a/ui/app/AppLayouts/Chat/views/ChatMessagesView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatMessagesView.qml @@ -358,6 +358,8 @@ Item { root.showReplyArea(messageId, author) } + onImageClicked: Global.openImagePopup(image) + stickersLoaded: root.stickersLoaded onVisibleChanged: { diff --git a/ui/imports/shared/views/chat/CompactMessageView.qml b/ui/imports/shared/views/chat/CompactMessageView.qml index 761bcc7ebb..26b73b3e8a 100644 --- a/ui/imports/shared/views/chat/CompactMessageView.qml +++ b/ui/imports/shared/views/chat/CompactMessageView.qml @@ -14,9 +14,11 @@ import StatusQ.Controls 0.1 as StatusQControls Item { id: root + property var messageStore + property var contactsStore + property var messageContextMenu property var container - property var contactsStore property int contentType property int chatHorizontalPadding: Style.current.halfPadding @@ -52,6 +54,8 @@ Item { signal addEmoji(bool isProfileClick, bool isSticker, bool isImage , var image, bool emojiOnly, bool hideEmojiPicker) signal clickMessage(bool isProfileClick, bool isSticker, bool isImage, var image, bool emojiOnly, bool hideEmojiPicker, bool isReply, bool isRightClickOnImage, string imageSource) signal replyClicked(string messageId, string author) + signal imageClicked(var image) + width: parent.width height: messageContainer.height + messageContainer.anchors.topMargin + (dateGroupLbl.visible ? dateGroupLbl.height + dateGroupLbl.anchors.topMargin : 0) @@ -497,7 +501,7 @@ Item { imageWidth: 200 onClicked: { if (mouse.button === Qt.LeftButton) { - messageStore.imageClick(image) + root.imageClicked(image) } else if (mouse.button === Qt.RightButton) { // Set parent, X & Y positions for the messageContextMenu diff --git a/ui/imports/shared/views/chat/MessageContextMenuView.qml b/ui/imports/shared/views/chat/MessageContextMenuView.qml index d1d758860a..980c7e4ed2 100644 --- a/ui/imports/shared/views/chat/MessageContextMenuView.qml +++ b/ui/imports/shared/views/chat/MessageContextMenuView.qml @@ -72,11 +72,6 @@ StatusPopupMenu { } function show(userNameParam, fromAuthorParam, identiconParam, textParam, nicknameParam, emojiReactionsModel) { - userName = userNameParam || "" - nickname = nicknameParam || "" - fromAuthor = fromAuthorParam || "" - identicon = identiconParam || "" - text = textParam || "" let newEmojiReactions = [] if (!!emojiReactionsModel) { emojiReactionsModel.forEach(function (emojiReaction) { diff --git a/ui/imports/shared/views/chat/MessageView.qml b/ui/imports/shared/views/chat/MessageView.qml index a44a129a20..df7f425624 100644 --- a/ui/imports/shared/views/chat/MessageView.qml +++ b/ui/imports/shared/views/chat/MessageView.qml @@ -12,6 +12,7 @@ import shared.controls.chat 1.0 Column { id: root + width: parent.width anchors.right: !isCurrentUser ? undefined : parent.right z: (typeof chatLogView === "undefined") ? 1 : (chatLogView.count - index) @@ -127,7 +128,7 @@ Column { property bool isStatusUpdate: false property int statusAgeEpoch: 0 - signal imageClick(var image) + signal imageClicked(var image) property var scrollToBottom: function () {} property var clickMessage: function(isProfileClick, @@ -320,10 +321,8 @@ Column { onAddEmoji: { root.clickMessage(isProfileClick, isSticker, isImage , image, emojiOnly, hideEmojiPicker); } - onChatImageClicked: { - // Not Refactored Yet - Should do it via messageStore -// root.imageClick(image); - } + onChatImageClicked: root.imageClicked(image) + onUserNameClicked: { // Not Refactored Yet - Should do it via messageStore // root.parent.clickMessage(isProfileClick); @@ -344,7 +343,9 @@ Column { Component { id: compactMessageComponent + CompactMessageView { + messageStore: root.messageStore contactsStore: root.contactsStore messageContextMenu: root.messageContextMenu contentType: root.messageContentType @@ -364,6 +365,7 @@ Column { onClickMessage: { root.clickMessage(isProfileClick, isSticker, isImage, image, emojiOnly, hideEmojiPicker, isReply, isRightClickOnImage, imageSource) } + onOpenStickerPackPopup: { root.openStickerPackPopup(stickerPackId); } @@ -371,6 +373,8 @@ Column { onReplyClicked: { root.showReplyArea(messageId, author) } + + onImageClicked: root.imageClicked(image) } } }