mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-30 18:39:23 +00:00
feat(ui/modules/Linphone/Chat/IncomingMessage): display avatar only for the first incoming message of a sequence
This commit is contained in:
parent
30d8de5149
commit
34fbdac7e2
1 changed files with 12 additions and 2 deletions
|
|
@ -21,8 +21,18 @@ RowLayout {
|
|||
anchors.centerIn: parent
|
||||
height: ChatStyle.entry.message.incoming.avatarSize
|
||||
image: _contactObserver.contact ? _contactObserver.contact.avatar : ''
|
||||
username: LinphoneUtils.getContactUsername(_contactObserver.contact || _contactObserver.sipAddress)
|
||||
username: LinphoneUtils.getContactUsername(_contactObserver.contact || proxyModel.sipAddress)
|
||||
width: ChatStyle.entry.message.incoming.avatarSize
|
||||
|
||||
// The avatar is only visible for the first message of a incoming messages sequence.
|
||||
visible: {
|
||||
if (index === 0) {
|
||||
return true
|
||||
}
|
||||
|
||||
var entry = proxyModel.data(proxyModel.index(index - 1, 0))
|
||||
return entry.type !== ChatModel.MessageEntry || entry.isOutgoing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -33,7 +43,7 @@ RowLayout {
|
|||
|
||||
// Not a style. Workaround to avoid a 0 width.
|
||||
// Arbitrary value.
|
||||
Layout.minimumWidth: 20
|
||||
Layout.minimumWidth: 1
|
||||
|
||||
backgroundColor: ChatStyle.entry.message.incoming.backgroundColor
|
||||
color: ChatStyle.entry.message.incoming.text.color
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue