UI fixes:

button color #LINQT-1894
fix display name call history
This commit is contained in:
Gaelle Braud 2025-09-23 18:07:03 +02:00
parent 598b45bbf4
commit e901f0046b
5 changed files with 18 additions and 16 deletions

View file

@ -128,14 +128,16 @@ void CallHistoryCore::setSelf(QSharedPointer<CallHistoryCore> me) {
mCoreModelConnection->makeConnectToModel(&CoreModel::friendRemoved, &CallHistoryCore::onRemoved); mCoreModelConnection->makeConnectToModel(&CoreModel::friendRemoved, &CallHistoryCore::onRemoved);
// Update display name when display name has been requested from magic search cause not found in linphone friends // 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) // (required to get the right display name if ldap friends cleared)
mCoreModelConnection->makeConnectToModel(&CoreModel::magicSearchResultReceived, // This replace the display name set by a user by a default one, use the linphone address to
[this, remoteAddress = mRemoteAddress] { // get a correct display name
auto displayName = ToolModel::getDisplayName(remoteAddress); // mCoreModelConnection->makeConnectToModel(&CoreModel::magicSearchResultReceived,
mCoreModelConnection->invokeToCore([this, displayName]() { // [this, remoteAddress = mRemoteAddress] {
mDisplayName = displayName; // auto displayName = ToolModel::getDisplayName(remoteAddress);
emit displayNameChanged(); // mCoreModelConnection->invokeToCore([this, displayName]() {
}); // mDisplayName = displayName;
}); // emit displayNameChanged();
// });
// });
} }
ConferenceInfoGui *CallHistoryCore::getConferenceInfoGui() const { ConferenceInfoGui *CallHistoryCore::getConferenceInfoGui() const {

View file

@ -60,10 +60,10 @@ ChatCore::ChatCore(const std::shared_ptr<linphone::ChatRoom> &chatRoom) : QObjec
if (chatRoom->hasCapability((int)linphone::ChatRoom::Capabilities::OneToOne)) { if (chatRoom->hasCapability((int)linphone::ChatRoom::Capabilities::OneToOne)) {
if (participants.size() > 0) { if (participants.size() > 0) {
auto peer = participants.front(); auto peer = participants.front();
if (peer) mTitle = ToolModel::getDisplayName(peer->getAddress()); auto peerAddress = peer->getAddress();
mAvatarUri = ToolModel::getDisplayName(peer->getAddress()); if (peer) mTitle = ToolModel::getDisplayName(peerAddress);
mAvatarUri = ToolModel::getDisplayName(peerAddress);
if (participants.size() == 1) { if (participants.size() == 1) {
auto peerAddress = peer->getAddress();
if (peerAddress) mParticipantAddress = Utils::coreStringToAppString(peerAddress->asStringUriOnly()); if (peerAddress) mParticipantAddress = Utils::coreStringToAppString(peerAddress->asStringUriOnly());
} }
} }

View file

@ -130,10 +130,9 @@ ListView {
spacing: Math.round(10 * DefaultStyle.dp) spacing: Math.round(10 * DefaultStyle.dp)
Avatar { Avatar {
id: historyAvatar id: historyAvatar
property var contactObj: UtilsCpp.findFriendByAddress( property var contactObj: UtilsCpp.findFriendByAddress(modelData.core.remoteAddress)
modelData.core.remoteAddress)
contact: contactObj?.value || null contact: contactObj?.value || null
_address: modelData.core.remoteAddress displayNameVal: modelData.core.displayName
secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
width: Math.round(45 * DefaultStyle.dp) width: Math.round(45 * DefaultStyle.dp)
height: Math.round(45 * DefaultStyle.dp) height: Math.round(45 * DefaultStyle.dp)
@ -149,7 +148,7 @@ ListView {
id: friendAddress id: friendAddress
Layout.fillWidth: true Layout.fillWidth: true
maximumLineCount: 1 maximumLineCount: 1
text: historyAvatar.displayNameVal text: modelData.core.displayName
font { font {
pixelSize: Typography.p1.pixelSize pixelSize: Typography.p1.pixelSize
weight: Typography.p1.weight weight: Typography.p1.weight

View file

@ -69,6 +69,7 @@ Notification {
Layout.preferredHeight: Math.round(60 * DefaultStyle.dp) Layout.preferredHeight: Math.round(60 * DefaultStyle.dp)
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
call: mainItem.call call: mainItem.call
displayNameVal: mainItem.displayName
secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
isConference: mainItem.call && mainItem.call.core.isConference isConference: mainItem.call && mainItem.call.core.isConference
} }

View file

@ -1265,7 +1265,7 @@ AbstractWindow {
background: Rectangle { background: Rectangle {
anchors.fill: parent anchors.fill: parent
radius: Math.round(71 * DefaultStyle.dp) 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 enabled: mainWindow.conference
|| mainWindow.callState != LinphoneEnums.CallState.PausedByRemote || mainWindow.callState != LinphoneEnums.CallState.PausedByRemote