From 76f1aec0e3623dc593e94800397425f685218f9d Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Fri, 9 Jul 2021 15:18:45 +0100 Subject: [PATCH] fix(@desktop/communities): disable edit for cleared message --- ui/app/AppLayouts/Chat/ChatColumn/Message.qml | 2 ++ .../Chat/ChatColumn/MessageComponents/ChatButtons.qml | 3 ++- .../Chat/ChatColumn/MessageComponents/CompactMessage.qml | 2 ++ ui/app/AppLayouts/Chat/components/PinnedMessagesPopup.qml | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/app/AppLayouts/Chat/ChatColumn/Message.qml b/ui/app/AppLayouts/Chat/ChatColumn/Message.qml index f2bd41892a..f2325d1d55 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/Message.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/Message.qml @@ -41,6 +41,7 @@ Item { property bool isEdit: false property string replaces: "" property bool isEdited: false + property bool showEdit: true z: { if (typeof chatLogView === "undefined") { @@ -438,6 +439,7 @@ Item { linkUrls: root.linkUrls isCurrentUser: root.isCurrentUser contentType: root.contentType + showEdit: root.showEdit container: root } } diff --git a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/ChatButtons.qml b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/ChatButtons.qml index 5abf5da94f..eb076baf31 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/ChatButtons.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/ChatButtons.qml @@ -6,6 +6,7 @@ import "../../../../../imports" Rectangle { property bool parentIsHovered: false + property bool showEdit: true signal hoverChanged(bool hovered) property int containerMargin: 2 property int contentType: 2 @@ -103,7 +104,7 @@ Rectangle { Loader { id: editBtn - active: isText && !isEdit && isCurrentUser + active: isText && !isEdit && isCurrentUser && showEdit sourceComponent: StatusIconButton { id: btn icon.name: "edit-message" diff --git a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/CompactMessage.qml b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/CompactMessage.qml index a1da137122..fca47950a8 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/CompactMessage.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/CompactMessage.qml @@ -15,6 +15,7 @@ Item { property bool isHovered: typeof hoveredMessage !== "undefined" && hoveredMessage === messageId property bool isMessageActive: typeof activeMessage !== "undefined" && activeMessage === messageId property bool headerRepeatCondition: (authorCurrentMsg !== authorPrevMsg || shouldRepeatHeader || dateGroupLbl.visible || chatReply.active) + property bool showEdit: true id: root @@ -40,6 +41,7 @@ Item { anchors.top: messageContainer.top // This is not exactly like the design because the hover becomes messed up with the buttons on top of another Message anchors.topMargin: -Style.current.halfPadding + showEdit: root.showEdit } Loader { diff --git a/ui/app/AppLayouts/Chat/components/PinnedMessagesPopup.qml b/ui/app/AppLayouts/Chat/components/PinnedMessagesPopup.qml index 16047774c4..888152353b 100644 --- a/ui/app/AppLayouts/Chat/components/PinnedMessagesPopup.qml +++ b/ui/app/AppLayouts/Chat/components/PinnedMessagesPopup.qml @@ -93,6 +93,7 @@ ModalPopup { pinnedBy: model.pinnedBy forceHoverHandler: true isEdited: model.isEdited + showEdit: false } } }