Skip to content
Snippets Groups Projects
Commit bd8938b1 authored by Capucine Berthet's avatar Capucine Berthet
Browse files

TextMessageDelegate: resolve binding loop issue

Change-Id: Ia17240ba8ff20dd09ad58463e44fbcdc2156ed78
parent 1e4c4504
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,6 @@ Control {
property bool textHovered: false
property alias replyAnimation: selectAnimation
width: listView.width
height: mainColumnLayout.implicitHeight
property real textContentWidth
property real textContentHeight
......
......@@ -33,7 +33,7 @@ SBSMessageBase {
property string colorUrl: UtilsAdapter.luma(bubble.color) ? JamiTheme.chatviewLinkColorLight : JamiTheme.chatviewLinkColorDark
property string colorText: UtilsAdapter.luma(bubble.color) ? JamiTheme.chatviewTextColorLight : JamiTheme.chatviewTextColorDark
bigMsg: (textEditId.lineCount > 1) || extraContent.active
Connections {
target: bubble
......@@ -46,6 +46,7 @@ SBSMessageBase {
}
}
isOutgoing: Author === CurrentAccount.uri
author: Author
readers: Readers
......@@ -54,9 +55,11 @@ SBSMessageBase {
formattedDay: MessagesAdapter.getFormattedDay(Timestamp)
extraHeight: extraContent.active && !isRemoteImage ? msgRadius : -isRemoteImage
textHovered: textHoverhandler.hovered
textContentWidth: textEditId.width + (bigMsg ? 0 : root.timeWidth + root.editedWidth)
textContentWidth: textEditId.width
textContentHeight: textEditId.height
bigMsg: textContentWidth >= (2 / 3) * root.maxMsgWidth || extraContent.active
innerContent.children: [
TextEdit {
id: textEditId
......@@ -87,11 +90,9 @@ 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.min((2 / 3) * root.maxMsgWidth, implicitWidth + 5 + root.timeWidth + root.editedWidth, innerContent.width - senderMargin + 5 + root.timeWidth + root.editedWidth);
}
anchors.rightMargin: bigMsg ? 0 : root.timeWidth + root.editedWidth
wrapMode: Label.WrapAtWordBoundaryOrAnywhere
selectByMouse: true
font.pointSize: isEmojiOnly ? JamiTheme.chatviewEmojiSize : (ParsedBody === "" ? JamiTheme.smallFontSize : JamiTheme.mediumFontSize)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment