Skip to content
Snippets Groups Projects
Commit a4b75861 authored by Capucine Berthet's avatar Capucine Berthet Committed by Sébastien Blin
Browse files

deletedMessage: new design

GitLab: #1325
Change-Id: I3bca1e25e9e66ffa86670bb5194812fb6d78ce8a
parent c00ea7ac
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......@@ -89,7 +94,7 @@ SBSMessageBase {
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;
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment