From e4952ab5c04c2ce8403c04bb7880151d158ca51f Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Wed, 11 Aug 2021 20:27:39 +0200 Subject: [PATCH] Tooltip on avatar (message and file message) --- .../src/components/chat-events/ChatMessageModel.cpp | 4 ++++ .../src/components/chat-events/ChatMessageModel.hpp | 2 ++ linphone-app/ui/modules/Linphone/Chat/FileMessage.qml | 9 ++++++++- linphone-app/ui/modules/Linphone/Chat/Message.qml | 8 ++++---- .../ui/modules/Linphone/Chat/OutgoingMessage.qml | 2 +- linphone-sdk | 2 +- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/linphone-app/src/components/chat-events/ChatMessageModel.cpp b/linphone-app/src/components/chat-events/ChatMessageModel.cpp index 6d77764ef..7dc160950 100644 --- a/linphone-app/src/components/chat-events/ChatMessageModel.cpp +++ b/linphone-app/src/components/chat-events/ChatMessageModel.cpp @@ -397,6 +397,10 @@ QString ChatMessageModel::getToDisplayName() const{ return Utils::getDisplayName(mChatMessage->getToAddress()); } +QString ChatMessageModel::getToSipAddress() const{ + return Utils::cleanSipAddress(Utils::coreStringToAppString(mChatMessage->getToAddress()->asStringUriOnly())); +} + ContactModel * ChatMessageModel::getContactModel() const{ return CoreManager::getInstance()->getContactsListModel()->findContactModelFromSipAddress(Utils::coreStringToAppString(mChatMessage->getFromAddress()->asString())); } diff --git a/linphone-app/src/components/chat-events/ChatMessageModel.hpp b/linphone-app/src/components/chat-events/ChatMessageModel.hpp index 9a5677523..f6ebbba5a 100644 --- a/linphone-app/src/components/chat-events/ChatMessageModel.hpp +++ b/linphone-app/src/components/chat-events/ChatMessageModel.hpp @@ -137,6 +137,7 @@ public: Q_PROPERTY(QString fromDisplayName READ getFromDisplayName CONSTANT) Q_PROPERTY(QString fromSipAddress READ getFromSipAddress CONSTANT) Q_PROPERTY(QString toDisplayName READ getToDisplayName CONSTANT) + Q_PROPERTY(QString toSipAddress READ getToSipAddress CONSTANT) Q_PROPERTY(ContactModel * contactModel READ getContactModel CONSTANT) Q_PROPERTY(bool isEphemeral READ isEphemeral NOTIFY isEphemeralChanged) @@ -162,6 +163,7 @@ public: QString getFromDisplayName() const; QString getFromSipAddress() const; QString getToDisplayName() const; + QString getToSipAddress() const; ContactModel * getContactModel() const; bool isEphemeral() const; Q_INVOKABLE qint64 getEphemeralExpireTime() const; diff --git a/linphone-app/ui/modules/Linphone/Chat/FileMessage.qml b/linphone-app/ui/modules/Linphone/Chat/FileMessage.qml index 517a59003..8135816e9 100644 --- a/linphone-app/ui/modules/Linphone/Chat/FileMessage.qml +++ b/linphone-app/ui/modules/Linphone/Chat/FileMessage.qml @@ -12,6 +12,7 @@ import Utils 1.0 // ============================================================================= Row { + id:mainRow // --------------------------------------------------------------------------- // Avatar if it's an incoming message. // --------------------------------------------------------------------------- @@ -30,7 +31,13 @@ Row { width: ChatStyle.entry.message.incoming.avatarSize image: $chatEntry.contactModel? $chatEntry.contactModel.vcard.avatar : '' //chat.sipAddressObserver.contact ? chat.sipAddressObserver.contact.vcard.avatar : '' - username: isOutgoing? $chatEntry.fromDisplayName : $chatEntry.toDisplayName + username: isOutgoing? $chatEntry.toDisplayName : $chatEntry.fromDisplayName + + TooltipArea{ + delay:0 + text:parent.username+'\n'+ (isOutgoing ? $chatEntry.toSipAddress : $chatEntry.fromSipAddress) + tooltipParent:mainRow + } } } diff --git a/linphone-app/ui/modules/Linphone/Chat/Message.qml b/linphone-app/ui/modules/Linphone/Chat/Message.qml index 8e897c614..1bd4853bb 100644 --- a/linphone-app/ui/modules/Linphone/Chat/Message.qml +++ b/linphone-app/ui/modules/Linphone/Chat/Message.qml @@ -217,10 +217,10 @@ Item { else return '' } delegate:Text{ - height:ChatStyle.composingText.height-5 - width:parent.width - text:deliveryLayout.getText(modelData.state, modelData.displayName, UtilsCpp.toDateTimeString(modelData.stateChangeTime)) - color:"#B1B1B1" + height: ChatStyle.composingText.height-5 + width: GridView.width + text: deliveryLayout.getText(modelData.state, modelData.displayName, UtilsCpp.toDateTimeString(modelData.stateChangeTime)) + color: "#B1B1B1" font.pointSize: Units.dp * 8 elide: Text.ElideMiddle } diff --git a/linphone-app/ui/modules/Linphone/Chat/OutgoingMessage.qml b/linphone-app/ui/modules/Linphone/Chat/OutgoingMessage.qml index b806a7875..e1788fd05 100644 --- a/linphone-app/ui/modules/Linphone/Chat/OutgoingMessage.qml +++ b/linphone-app/ui/modules/Linphone/Chat/OutgoingMessage.qml @@ -45,7 +45,7 @@ Item { icon: isError ? 'chat_error' - : (isRead ? 'chat_read' : isDelivered ? 'chat_delivered' : '') + : (isRead ? 'chat_read' : (isDelivered ? 'chat_delivered' : '' ) ) iconSize: ChatStyle.entry.message.outgoing.sendIconSize MouseArea { diff --git a/linphone-sdk b/linphone-sdk index c62b1fdc3..70c8ce09e 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit c62b1fdc3c5e68ebd77794d6991ab7e68519c0cd +Subproject commit 70c8ce09ec0171ed4c877b0770f306bb86072df2