From edb103ee01c80656e111873bba3827cdc1de1814 Mon Sep 17 00:00:00 2001 From: Khushboo Mehta Date: Tue, 2 Nov 2021 20:58:48 +0100 Subject: [PATCH] fix(@desktop/chat): Modal on the Pinned Messages Popup isnt seen fixes #4002 --- .../Chat/panels/ChatButtonsPanel.qml | 4 ++-- .../Chat/popups/PinnedMessagesPopup.qml | 24 ++++++++----------- .../Chat/views/CompactMessageView.qml | 2 +- ui/app/AppLayouts/Chat/views/MessageView.qml | 2 +- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/ui/app/AppLayouts/Chat/panels/ChatButtonsPanel.qml b/ui/app/AppLayouts/Chat/panels/ChatButtonsPanel.qml index 2dc50c7228..0787ba25f5 100644 --- a/ui/app/AppLayouts/Chat/panels/ChatButtonsPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/ChatButtonsPanel.qml @@ -17,7 +17,7 @@ Rectangle { property alias editBtnActive: editBtn.active signal hoverChanged(bool hovered) signal setMessageActive(string messageId, bool active) - signal clickMessage(bool isProfileClick, bool isSticker, bool isImage, var image, bool emojiOnly) + signal clickMessage(bool isProfileClick, bool isSticker, bool isImage, var image, bool emojiOnly, bool hideEmojiPicker) visible: !placeholderMessage && !activityCenterMessage && (buttonsContainer.parentIsHovered || isMessageActive) @@ -77,7 +77,7 @@ Rectangle { buttonsContainer.messageContextMenu.parent = buttonsContainer buttonsContainer.messageContextMenu.setXPosition = function() { return (-Math.abs(buttonsContainer.width - buttonsContainer.messageContextMenu.emojiContainer.width))} buttonsContainer.messageContextMenu.setYPosition = function() { return (-buttonsContainer.messageContextMenu.height - 4)} - clickMessage(false, false, false, null, true) + clickMessage(false, false, false, null, true, false) } onHoveredChanged: buttonsContainer.hoverChanged(this.hovered) } diff --git a/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml b/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml index 3a7ba05a2a..a841ab6397 100644 --- a/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml @@ -107,10 +107,6 @@ ModalPopup { anchors.top: parent.top anchors.topMargin: -Style.current.halfPadding clip: true - - function closePopup() { - popup.close() - } delegate: Item { id: messageDelegate @@ -183,16 +179,6 @@ ModalPopup { messageStore.showEdit = false; messageStore.messageContextMenu = msgContextMenu; } - MessageContextMenuView { - id: msgContextMenu - pinnedPopup: true - pinnedMessage: true - store: popup.rootStore - reactionModel: popup.rootStore.emojiReactionsModel - onShouldCloseParentPopup: { - messageDelegate.listView.closePopup(); - } - } } MouseArea { @@ -218,6 +204,16 @@ ModalPopup { } } } + } + MessageContextMenuView { + id: msgContextMenu + pinnedPopup: true + pinnedMessage: true + store: popup.rootStore + reactionModel: popup.rootStore.emojiReactionsModel + onShouldCloseParentPopup: { + popup.close() + } } } diff --git a/ui/app/AppLayouts/Chat/views/CompactMessageView.qml b/ui/app/AppLayouts/Chat/views/CompactMessageView.qml index ce302d5c89..66d330a6e7 100644 --- a/ui/app/AppLayouts/Chat/views/CompactMessageView.qml +++ b/ui/app/AppLayouts/Chat/views/CompactMessageView.qml @@ -80,7 +80,7 @@ Item { fromAuthor: fromAuthor editBtnActive: isText && !isEdit && isCurrentUser && showEdit onClickMessage: { - parent.parent.parent.clickMessage(isProfileClick, isSticker, isImage, image, emojiOnly); + parent.parent.parent.clickMessage(isProfileClick, isSticker, isImage, image, emojiOnly, hideEmojiPicker); } } diff --git a/ui/app/AppLayouts/Chat/views/MessageView.qml b/ui/app/AppLayouts/Chat/views/MessageView.qml index 26367f0385..92384ec487 100644 --- a/ui/app/AppLayouts/Chat/views/MessageView.qml +++ b/ui/app/AppLayouts/Chat/views/MessageView.qml @@ -190,7 +190,7 @@ Column { function showReactionAuthors(fromAccounts, emojiId) { - return store.showReactionAuthors(fromAccounts, emojiId) + return root.rootStore.showReactionAuthors(fromAccounts, emojiId) } function startMessageFoundAnimation() {