linphone-desktop/linphone-app/ui/modules/Linphone/Chat/IncomingMessage.qml
Julien Wadel 4532e278ac New chat layout :
- Split content type to be filtered by proxy lists.
- Add a message in notification when receiving a conference invitation.
- Change chat bubbles colors to match mobile application.
- Change date display on messages to remove sections. It allows to be more coherent when sorting messages.
- Change Chat Layout : outgoing messages to right, incoming messages to left.
- Change bubble design to be squared when grouped.
- Group messages on 1 second away from previous (and same sender).
- Add a background color with radius to files in reply messages.
- Make color corners on reply.
- Fix filename to 2 lines in file download icon.
- Add a background color on conference invitations.
- Change conference title from bold to normal on invitations.
- Rework chat message content layout to be used with grids and lists : files are now displayed in grid.
- Remove cyclic dependencies with reply design (which was recursivly linked with ChatContent).
- Fix center layouts that were not bind to the correct one.
- Align pictures to center.
- Fix hidden admin usernames in participant view.
2023-03-03 17:09:25 +01:00

91 lines
2.8 KiB
QML

import QtQuick 2.7
import QtQuick.Layouts 1.3
import Common 1.0
import Linphone 1.0
import Linphone.Styles 1.0
// =============================================================================
RowLayout {
id:mainRow
Layout.fillWidth: true
property alias isHovering: message.isHovering
property alias isTopGrouped: message.isTopGrouped
property alias isBottomGrouped: message.isBottomGrouped
signal copyAllDone()
signal copySelectionDone()
signal replyClicked()
signal forwardClicked()
signal goToMessage(ChatMessageModel message)
signal conferenceIcsCopied()
signal addContactClicked(string contactAddress)
signal viewContactClicked(string contactAddress)
implicitHeight: message.height
spacing: 0
Item {
Layout.alignment: Qt.AlignTop
Layout.preferredHeight: ChatStyle.entry.lineHeight
Layout.preferredWidth: ChatStyle.entry.metaWidth
Avatar {
id:avatar
anchors.centerIn: parent
height: ChatStyle.entry.message.incoming.avatarSize
image: $chatEntry.contactModel? $chatEntry.contactModel.vcard.avatar : '' //chat.sipAddressObserver.contact ? chat.sipAddressObserver.contact.vcard.avatar : ''
username: $chatEntry.fromDisplayName
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 // 1. First message, so visible.
}
var previousEntry = proxyModel.getAt(index - 1)
return !$chatEntry.isOutgoing && (// Only outgoing
!previousEntry //No previous entry
|| previousEntry.type != ChatRoomModel.MessageEntry // Previous entry is a message
|| previousEntry.fromSipAddress != $chatEntry.fromSipAddress // Different user
|| (new Date(previousEntry.timestamp)).setHours(0, 0, 0, 0) != (new Date($chatEntry.timestamp)).setHours(0, 0, 0, 0) // Same day == section
)
}
TooltipArea{
delay:0
text:avatar.username+'\n'+$chatEntry.fromSipAddress
tooltipParent:mainRow
isClickable: true
onDoubleClicked: {
window.mainSearchBar.text = $chatEntry.fromSipAddress
}
}
}
}
Message {
id: message
onCopyAllDone: mainRow.copyAllDone()
onCopySelectionDone: mainRow.copySelectionDone()
onReplyClicked: mainRow.replyClicked()
onForwardClicked: mainRow.forwardClicked()
onGoToMessage: mainRow.goToMessage(message)
onConferenceIcsCopied: mainRow.conferenceIcsCopied()
onAddContactClicked: mainRow.addContactClicked(contactAddress)
onViewContactClicked: mainRow.viewContactClicked(contactAddress)
Layout.fillWidth: true
Layout.rightMargin: 10
// Not a style. Workaround to avoid a 0 width.
// Arbitrary value.
Layout.minimumWidth: 1
backgroundColorModel: ChatStyle.entry.message.incoming.backgroundColor
}
}