From fa2caa6d7c2faa229d1d36a633850edd43a05d8d Mon Sep 17 00:00:00 2001
From: cberthet <capucine.berthet@savoirfairelinux.com>
Date: Mon, 8 Jan 2024 12:18:09 -0500
Subject: [PATCH] editedMessage: enable click on "edited" to open previous
 bodies popup

Change-Id: I45a55c57337029d3357bb1059a6d26a9656fe9b1
---
 src/app/commoncomponents/SBSMessageBase.qml      | 3 +--
 src/app/commoncomponents/TextMessageDelegate.qml | 3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/app/commoncomponents/SBSMessageBase.qml b/src/app/commoncomponents/SBSMessageBase.qml
index 3f98da23a..24e341cb5 100644
--- a/src/app/commoncomponents/SBSMessageBase.qml
+++ b/src/app/commoncomponents/SBSMessageBase.qml
@@ -364,7 +364,7 @@ Control {
                     property bool bubbleHovered
                     property string imgSource
 
-                    width: (root.type === Interaction.Type.TEXT ? root.textContentWidth : innerContent.childrenRect.width)
+                    width: (root.type === Interaction.Type.TEXT ? root.textContentWidth + ( IsEmojiOnly || root.bigMsg ? 0 : root.timeWidth + root.editedWidth): innerContent.childrenRect.width)
                     height: innerContent.childrenRect.height + (visible ? root.extraHeight : 0) + (root.bigMsg ? 15 : 0)
 
                     HoverHandler {
@@ -408,7 +408,6 @@ Control {
                         anchors.leftMargin: root.bigMsg ? 10 : - timestampItem.width - 16
                         visible: bubble.isEdited
                         z: 1
-
                         ResponsiveImage {
                             id: editedImage
                             source: JamiResources.round_edit_24dp_svg
diff --git a/src/app/commoncomponents/TextMessageDelegate.qml b/src/app/commoncomponents/TextMessageDelegate.qml
index 2e06879fc..d10947f3e 100644
--- a/src/app/commoncomponents/TextMessageDelegate.qml
+++ b/src/app/commoncomponents/TextMessageDelegate.qml
@@ -68,6 +68,7 @@ SBSMessageBase {
             topPadding: bubble.isDeleted ? 6 : 10
             bottomPadding: bubble.isDeleted ? 6 : 10
             anchors.right: isOutgoing ? parent.right : undefined
+            anchors.rightMargin: isOutgoing && !isEmojiOnly ? root.timeWidth + root.editedWidth : 0
             text: {
                 if (Body !== "" && ParsedBody.length === 0) {
                     MessagesAdapter.parseMessage(Id, Body, UtilsAdapter.getAppValue(Settings.DisplayHyperlinkPreviews), root.colorUrl, bubble.color);
@@ -90,7 +91,7 @@ SBSMessageBase {
                 else if (isEmojiOnly)
                     Math.min((2 / 3) * root.maxMsgWidth, implicitWidth, innerContent.width - senderMargin - (innerContent.width - senderMargin) % (JamiTheme.chatviewEmojiSize + 2));
                 else
-                    Math.min((2 / 3) * root.maxMsgWidth, implicitWidth + 5 + root.timeWidth + root.editedWidth, innerContent.width - senderMargin + 5 + root.timeWidth + root.editedWidth);
+                    Math.min((2 / 3) * root.maxMsgWidth, implicitWidth + 5, innerContent.width - senderMargin + 5);
             }
 
             wrapMode: Label.WrapAtWordBoundaryOrAnywhere
-- 
GitLab