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
|
id: bubble
|
||||||
|
|
||||||
property bool isEdited: PreviousBodies.length !== 0
|
property bool isEdited: PreviousBodies.length !== 0
|
||||||
|
property bool isDeleted: false
|
||||||
z: -1
|
z: -1
|
||||||
out: isOutgoing
|
out: isOutgoing
|
||||||
type: seq
|
type: seq
|
||||||
|
@ -363,7 +364,7 @@ Control {
|
||||||
timeLabel.Layout.bottomMargin: {
|
timeLabel.Layout.bottomMargin: {
|
||||||
if (IsEmojiOnly)
|
if (IsEmojiOnly)
|
||||||
return -15;
|
return -15;
|
||||||
if (root.bigMsg)
|
if (root.bigMsg || bubble.isDeleted)
|
||||||
return 5;
|
return 5;
|
||||||
return 9;
|
return 9;
|
||||||
}
|
}
|
||||||
|
@ -373,7 +374,7 @@ Control {
|
||||||
id: editedRow
|
id: editedRow
|
||||||
anchors.left: root.bigMsg ? bubble.left : timestampItem.left
|
anchors.left: root.bigMsg ? bubble.left : timestampItem.left
|
||||||
anchors.bottom: parent.bottom
|
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
|
anchors.leftMargin: root.bigMsg ? 10 : - timestampItem.width - 10
|
||||||
visible: bubble.isEdited
|
visible: bubble.isEdited
|
||||||
z: 1
|
z: 1
|
||||||
|
|
|
@ -61,14 +61,19 @@ SBSMessageBase {
|
||||||
TextEdit {
|
TextEdit {
|
||||||
id: textEditId
|
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
|
anchors.right: isOutgoing ? parent.right : undefined
|
||||||
text: {
|
text: {
|
||||||
if (Body !== "" && ParsedBody.length === 0) {
|
if (Body !== "" && ParsedBody.length === 0) {
|
||||||
MessagesAdapter.parseMessage(Id, Body, UtilsAdapter.getAppValue(Settings.DisplayHyperlinkPreviews), root.colorUrl, bubble.color);
|
MessagesAdapter.parseMessage(Id, Body, UtilsAdapter.getAppValue(Settings.DisplayHyperlinkPreviews), root.colorUrl, bubble.color);
|
||||||
return "";
|
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
|
horizontalAlignment: Text.AlignLeft
|
||||||
|
|
||||||
|
@ -82,14 +87,14 @@ SBSMessageBase {
|
||||||
else if (isEmojiOnly)
|
else if (isEmojiOnly)
|
||||||
Math.min((2 / 3) * root.maxMsgWidth, implicitWidth, innerContent.width - senderMargin - (innerContent.width - senderMargin) % (JamiTheme.chatviewEmojiSize + 2));
|
Math.min((2 / 3) * root.maxMsgWidth, implicitWidth, innerContent.width - senderMargin - (innerContent.width - senderMargin) % (JamiTheme.chatviewEmojiSize + 2));
|
||||||
else
|
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
|
anchors.rightMargin: bigMsg ? 0 : root.timeWidth + root.editedWidth
|
||||||
|
|
||||||
wrapMode: Label.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Label.WrapAtWordBoundaryOrAnywhere
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
font.pointSize: isEmojiOnly ? JamiTheme.chatviewEmojiSize : JamiTheme.mediumFontSize
|
font.pointSize: isEmojiOnly ? JamiTheme.chatviewEmojiSize : (ParsedBody === "" ? JamiTheme.smallFontSize : JamiTheme.mediumFontSize)
|
||||||
font.hintingPreference: Font.PreferNoHinting
|
font.hintingPreference: Font.PreferNoHinting
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
textFormat: Text.RichText
|
textFormat: Text.RichText
|
||||||
|
@ -97,7 +102,8 @@ SBSMessageBase {
|
||||||
onLinkHovered: root.hoveredLink = hoveredLink
|
onLinkHovered: root.hoveredLink = hoveredLink
|
||||||
onLinkActivated: Qt.openUrlExternally(new URL(hoveredLink))
|
onLinkActivated: Qt.openUrlExternally(new URL(hoveredLink))
|
||||||
readOnly: true
|
readOnly: true
|
||||||
color: getBaseColor()
|
color: (ParsedBody !== "") ? getBaseColor() : (UtilsAdapter.luma(bubble.color) ? "white" : "dark")
|
||||||
|
opacity:(ParsedBody !== "") ? 1 : 0.5
|
||||||
|
|
||||||
function getBaseColor() {
|
function getBaseColor() {
|
||||||
var baseColor;
|
var baseColor;
|
||||||
|
|
|
@ -344,7 +344,7 @@ Item {
|
||||||
property string backendError: qsTr("This is the error from the backend: %0")
|
property string backendError: qsTr("This is the error from the backend: %0")
|
||||||
property string disabledAccount: qsTr("The account is disabled")
|
property string disabledAccount: qsTr("The account is disabled")
|
||||||
property string noNetworkConnectivity: qsTr("No network connectivity")
|
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")
|
property string backCall: qsTr("Back to Call")
|
||||||
|
|
||||||
//MessagesResearch
|
//MessagesResearch
|
||||||
|
|
Loading…
Add table
Reference in a new issue