From e901f0046b06aa0e9e96c360a2b559a62da86953 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Tue, 23 Sep 2025 18:07:03 +0200 Subject: [PATCH] UI fixes: button color #LINQT-1894 fix display name call history --- Linphone/core/call-history/CallHistoryCore.cpp | 18 ++++++++++-------- Linphone/core/chat/ChatCore.cpp | 6 +++--- .../Display/Call/CallHistoryListView.qml | 7 +++---- .../Notification/NotificationReceivedCall.qml | 1 + Linphone/view/Page/Window/Call/CallsWindow.qml | 2 +- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/Linphone/core/call-history/CallHistoryCore.cpp b/Linphone/core/call-history/CallHistoryCore.cpp index adc739e69..8994649dd 100644 --- a/Linphone/core/call-history/CallHistoryCore.cpp +++ b/Linphone/core/call-history/CallHistoryCore.cpp @@ -128,14 +128,16 @@ void CallHistoryCore::setSelf(QSharedPointer me) { mCoreModelConnection->makeConnectToModel(&CoreModel::friendRemoved, &CallHistoryCore::onRemoved); // Update display name when display name has been requested from magic search cause not found in linphone friends // (required to get the right display name if ldap friends cleared) - mCoreModelConnection->makeConnectToModel(&CoreModel::magicSearchResultReceived, - [this, remoteAddress = mRemoteAddress] { - auto displayName = ToolModel::getDisplayName(remoteAddress); - mCoreModelConnection->invokeToCore([this, displayName]() { - mDisplayName = displayName; - emit displayNameChanged(); - }); - }); + // This replace the display name set by a user by a default one, use the linphone address to + // get a correct display name + // mCoreModelConnection->makeConnectToModel(&CoreModel::magicSearchResultReceived, + // [this, remoteAddress = mRemoteAddress] { + // auto displayName = ToolModel::getDisplayName(remoteAddress); + // mCoreModelConnection->invokeToCore([this, displayName]() { + // mDisplayName = displayName; + // emit displayNameChanged(); + // }); + // }); } ConferenceInfoGui *CallHistoryCore::getConferenceInfoGui() const { diff --git a/Linphone/core/chat/ChatCore.cpp b/Linphone/core/chat/ChatCore.cpp index 9a6835f89..978c86ae4 100644 --- a/Linphone/core/chat/ChatCore.cpp +++ b/Linphone/core/chat/ChatCore.cpp @@ -60,10 +60,10 @@ ChatCore::ChatCore(const std::shared_ptr &chatRoom) : QObjec if (chatRoom->hasCapability((int)linphone::ChatRoom::Capabilities::OneToOne)) { if (participants.size() > 0) { auto peer = participants.front(); - if (peer) mTitle = ToolModel::getDisplayName(peer->getAddress()); - mAvatarUri = ToolModel::getDisplayName(peer->getAddress()); + auto peerAddress = peer->getAddress(); + if (peer) mTitle = ToolModel::getDisplayName(peerAddress); + mAvatarUri = ToolModel::getDisplayName(peerAddress); if (participants.size() == 1) { - auto peerAddress = peer->getAddress(); if (peerAddress) mParticipantAddress = Utils::coreStringToAppString(peerAddress->asStringUriOnly()); } } diff --git a/Linphone/view/Control/Display/Call/CallHistoryListView.qml b/Linphone/view/Control/Display/Call/CallHistoryListView.qml index 4c20b23ad..e886ee8d6 100644 --- a/Linphone/view/Control/Display/Call/CallHistoryListView.qml +++ b/Linphone/view/Control/Display/Call/CallHistoryListView.qml @@ -130,10 +130,9 @@ ListView { spacing: Math.round(10 * DefaultStyle.dp) Avatar { id: historyAvatar - property var contactObj: UtilsCpp.findFriendByAddress( - modelData.core.remoteAddress) + property var contactObj: UtilsCpp.findFriendByAddress(modelData.core.remoteAddress) contact: contactObj?.value || null - _address: modelData.core.remoteAddress + displayNameVal: modelData.core.displayName secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified width: Math.round(45 * DefaultStyle.dp) height: Math.round(45 * DefaultStyle.dp) @@ -149,7 +148,7 @@ ListView { id: friendAddress Layout.fillWidth: true maximumLineCount: 1 - text: historyAvatar.displayNameVal + text: modelData.core.displayName font { pixelSize: Typography.p1.pixelSize weight: Typography.p1.weight diff --git a/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml b/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml index ff3269a85..d5966ded6 100644 --- a/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml +++ b/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml @@ -69,6 +69,7 @@ Notification { Layout.preferredHeight: Math.round(60 * DefaultStyle.dp) Layout.alignment: Qt.AlignHCenter call: mainItem.call + displayNameVal: mainItem.displayName secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified isConference: mainItem.call && mainItem.call.core.isConference } diff --git a/Linphone/view/Page/Window/Call/CallsWindow.qml b/Linphone/view/Page/Window/Call/CallsWindow.qml index 26432068b..078acb62a 100644 --- a/Linphone/view/Page/Window/Call/CallsWindow.qml +++ b/Linphone/view/Page/Window/Call/CallsWindow.qml @@ -1265,7 +1265,7 @@ AbstractWindow { background: Rectangle { anchors.fill: parent radius: Math.round(71 * DefaultStyle.dp) - color: parent.enabled ? parent.checked ? DefaultStyle.success_500main : parent.pressed ? DefaultStyle.main2_400 : DefaultStyle.grey_500 : DefaultStyle.grey_600 + color: parent.enabled ? parent.checked ? DefaultStyle.success_500main : parent.pressed || parent.hovered ? DefaultStyle.main2_400 : DefaultStyle.grey_500 : DefaultStyle.grey_600 } enabled: mainWindow.conference || mainWindow.callState != LinphoneEnums.CallState.PausedByRemote