mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 12:03:18 +02:00
deletedMessage: new design
GitLab: #1325 Change-Id: I3bca1e25e9e66ffa86670bb5194812fb6d78ce8a
This commit is contained in:
parent
c00ea7ac51
commit
a4b758611c
3 changed files with 15 additions and 8 deletions
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue