diff --git a/src/app/commoncomponents/SBSMessageBase.qml b/src/app/commoncomponents/SBSMessageBase.qml index 744dfe80dfa6edb4b0a2812fdb3fd6a4cc0a2a93..0121b278ba2011c8859da1105e4c0c02af56bd93 100644 --- a/src/app/commoncomponents/SBSMessageBase.qml +++ b/src/app/commoncomponents/SBSMessageBase.qml @@ -331,6 +331,7 @@ Control { id: bubble property bool isEdited: PreviousBodies.length !== 0 + property bool isDeleted: false z: -1 out: isOutgoing type: seq @@ -363,7 +364,7 @@ Control { timeLabel.Layout.bottomMargin: { if (IsEmojiOnly) return -15; - if (root.bigMsg) + if (root.bigMsg || bubble.isDeleted) return 5; return 9; } @@ -373,7 +374,7 @@ Control { id: editedRow anchors.left: root.bigMsg ? bubble.left : timestampItem.left anchors.bottom: parent.bottom - anchors.bottomMargin: root.bigMsg ? 6 : 10 + anchors.bottomMargin: root.bigMsg || bubble.isDeleted ? 6 : 10 anchors.leftMargin: root.bigMsg ? 10 : - timestampItem.width - 10 visible: bubble.isEdited z: 1 diff --git a/src/app/commoncomponents/TextMessageDelegate.qml b/src/app/commoncomponents/TextMessageDelegate.qml index 7004c25805386cf465fb9d98b7a4e7349c91a24c..ce5fe1bcc3df93de418653e681490d5b85efb4cc 100644 --- a/src/app/commoncomponents/TextMessageDelegate.qml +++ b/src/app/commoncomponents/TextMessageDelegate.qml @@ -61,14 +61,19 @@ SBSMessageBase { TextEdit { id: textEditId - padding: isEmojiOnly ? 0 : 10 + padding: isEmojiOnly ? 5 : 10 + topPadding: bubble.isDeleted ? 6 : 10 + bottomPadding: bubble.isDeleted ? 6 : 10 anchors.right: isOutgoing ? parent.right : undefined text: { if (Body !== "" && ParsedBody.length === 0) { MessagesAdapter.parseMessage(Id, Body, UtilsAdapter.getAppValue(Settings.DisplayHyperlinkPreviews), root.colorUrl, bubble.color); return ""; } - return (ParsedBody !== "") ? ParsedBody : "<i>(" + JamiStrings.deletedMessage + ")</i>"; + if (ParsedBody !== "") + return ParsedBody; + bubble.isDeleted = true; + return UtilsAdapter.getBestNameForUri(CurrentAccount.id, Author) + " " + JamiStrings.deletedMessage ; } horizontalAlignment: Text.AlignLeft @@ -82,14 +87,14 @@ SBSMessageBase { else if (isEmojiOnly) Math.min((2 / 3) * root.maxMsgWidth, implicitWidth, innerContent.width - senderMargin - (innerContent.width - senderMargin) % (JamiTheme.chatviewEmojiSize + 2)); else - Math.max(Math.min((2 / 3) * root.maxMsgWidth - ( bigMsg ? 0 : root.timeWidth + root.editedWidth), implicitWidth + 5, innerContent.width - senderMargin + 5), bigMsg ? root.timeWidth + root.editedWidth + 14: 0) ; + Math.max(Math.min((2 / 3) * root.maxMsgWidth - ( bigMsg ? 0 : root.timeWidth + root.editedWidth), implicitWidth + 5, innerContent.width - senderMargin + 5 ), bigMsg ? root.timeWidth + root.editedWidth + 14: 0) ; } anchors.rightMargin: bigMsg ? 0 : root.timeWidth + root.editedWidth wrapMode: Label.WrapAtWordBoundaryOrAnywhere selectByMouse: true - font.pointSize: isEmojiOnly ? JamiTheme.chatviewEmojiSize : JamiTheme.mediumFontSize + font.pointSize: isEmojiOnly ? JamiTheme.chatviewEmojiSize : (ParsedBody === "" ? JamiTheme.smallFontSize : JamiTheme.mediumFontSize) font.hintingPreference: Font.PreferNoHinting renderType: Text.NativeRendering textFormat: Text.RichText @@ -97,7 +102,8 @@ SBSMessageBase { onLinkHovered: root.hoveredLink = hoveredLink onLinkActivated: Qt.openUrlExternally(new URL(hoveredLink)) readOnly: true - color: getBaseColor() + color: (ParsedBody !== "") ? getBaseColor() : (UtilsAdapter.luma(bubble.color) ? "white" : "dark") + opacity:(ParsedBody !== "") ? 1 : 0.5 function getBaseColor() { var baseColor; diff --git a/src/app/constant/JamiStrings.qml b/src/app/constant/JamiStrings.qml index 5418db7b1625a397d31265860dbf9e099d296143..28fda05b43cabed80ff116c04663615aeb5231c8 100644 --- a/src/app/constant/JamiStrings.qml +++ b/src/app/constant/JamiStrings.qml @@ -344,7 +344,7 @@ Item { property string backendError: qsTr("This is the error from the backend: %0") property string disabledAccount: qsTr("The account is disabled") property string noNetworkConnectivity: qsTr("No network connectivity") - property string deletedMessage: qsTr("Deleted message") + property string deletedMessage: qsTr("deleted a message") property string backCall: qsTr("Back to Call") //MessagesResearch