From 844ab4ecbbbe42edefd60a2130c8ffd70c732b08 Mon Sep 17 00:00:00 2001 From: gaelle Date: Tue, 15 Apr 2025 16:53:34 +0200 Subject: [PATCH] contact edition : add mouse area to loose focus when click outside sip address force expand contact list when becomes visible hide preview sticker when ringing --- Linphone/core/call/CallList.cpp | 2 +- Linphone/model/tool/ToolModel.cpp | 10 +++++----- .../Control/Container/Call/ActiveSpeakerLayout.qml | 4 +++- .../view/Control/Container/Main/MainRightPanel.qml | 6 ++++++ .../Control/Display/Contact/ContactListView.qml | 2 ++ Linphone/view/Control/Display/Sticker.qml | 13 ++++++------- Linphone/view/Page/Form/Contact/ContactEdition.qml | 10 +++++++++- 7 files changed, 32 insertions(+), 15 deletions(-) diff --git a/Linphone/core/call/CallList.cpp b/Linphone/core/call/CallList.cpp index c5dc1a293..96ac873fb 100644 --- a/Linphone/core/call/CallList.cpp +++ b/Linphone/core/call/CallList.cpp @@ -129,7 +129,7 @@ void CallList::setSelf(QSharedPointer me) { }); mModelConnection->makeConnectToModel(&CoreModel::firstCallStarted, - [this]() { mModelConnection->invokeToCore([this]() { setHaveCall(true); }); }); + [this]() { mModelConnection->invokeToCore([this]() { lUpdate(); }); }); mModelConnection->makeConnectToModel(&CoreModel::lastCallEnded, [this]() { mModelConnection->invokeToCore([this]() { setHaveCall(false); diff --git a/Linphone/model/tool/ToolModel.cpp b/Linphone/model/tool/ToolModel.cpp index 6c5c61044..d312e812c 100644 --- a/Linphone/model/tool/ToolModel.cpp +++ b/Linphone/model/tool/ToolModel.cpp @@ -130,10 +130,10 @@ std::shared_ptr ToolModel::findFriendByAddress(std::shared_ptr auto friendsManager = FriendsManager::getInstance(); QString key = Utils::coreStringToAppString(linphoneAddr->asStringUriOnly()); if (friendsManager->isInKnownFriends(key)) { - qDebug() << "Friend have been found in known friend, return it"; +// qDebug() << "Friend have been found in known friend, return it"; return friendsManager->getKnownFriendAtKey(key); } else if (friendsManager->isInUnknownFriends(key)) { - qDebug() << "Friend have been found in unknown friend, return it"; +// qDebug() << "Friend have been found in unknown friend, return it"; return friendsManager->getUnknownFriendAtKey(key); } auto f = CoreModel::getInstance()->getCore()->findFriend(linphoneAddr); @@ -141,16 +141,16 @@ std::shared_ptr ToolModel::findFriendByAddress(std::shared_ptr if (friendsManager->isInUnknownFriends(key)) { friendsManager->removeUnknownFriend(key); } - qDebug() << "found friend, add to known map"; +// qDebug() << "found friend, add to known map"; friendsManager->appendKnownFriend(linphoneAddr, f); } if (!f) { if (friendsManager->isInOtherAddresses(key)) { - qDebug() << "A magic search has already be done for this address and nothing was found, return"; +// qDebug() << "A magic search has already be done for address" << key << "and nothing was found, return"; return nullptr; } friendsManager->appendOtherAddress(key); - qDebug() << "Couldn't find friend" << linphoneAddr->asStringUriOnly() << "in core, use magic search"; +// qDebug() << "Couldn't find friend" << linphoneAddr->asStringUriOnly() << "in core, use magic search"; CoreModel::getInstance()->searchInMagicSearch(Utils::coreStringToAppString(linphoneAddr->asStringUriOnly()), (int)linphone::MagicSearch::Source::LdapServers | (int)linphone::MagicSearch::Source::RemoteCardDAV diff --git a/Linphone/view/Control/Container/Call/ActiveSpeakerLayout.qml b/Linphone/view/Control/Container/Call/ActiveSpeakerLayout.qml index 7b16a0f66..87bf83541 100644 --- a/Linphone/view/Control/Container/Call/ActiveSpeakerLayout.qml +++ b/Linphone/view/Control/Container/Call/ActiveSpeakerLayout.qml @@ -89,7 +89,9 @@ Item { id: preview qmlName: 'P' previewEnabled: true - visible: !sideStickers.visible + visible: !sideStickers.visible && mainItem.callState !== LinphoneEnums.CallState.OutgoingProgress + && mainItem.callState !== LinphoneEnums.CallState.OutgoingRinging + && mainItem.callState !== LinphoneEnums.CallState.OutgoingInit onVisibleChanged: console.log(visible + " : " +allDevices.count) height: Math.round(180 * DefaultStyle.dp) width: Math.round(300 * DefaultStyle.dp) diff --git a/Linphone/view/Control/Container/Main/MainRightPanel.qml b/Linphone/view/Control/Container/Main/MainRightPanel.qml index 57755a4b4..079647afd 100644 --- a/Linphone/view/Control/Container/Main/MainRightPanel.qml +++ b/Linphone/view/Control/Container/Main/MainRightPanel.qml @@ -24,5 +24,11 @@ ColumnLayout { color: mainItem.panelColor Layout.fillWidth: true Layout.fillHeight: true + MouseArea { + anchors.fill: parent + onClicked: { + rightPanelContent.forceActiveFocus() + } + } } } diff --git a/Linphone/view/Control/Display/Contact/ContactListView.qml b/Linphone/view/Control/Display/Contact/ContactListView.qml index 6c010da22..da6650cdf 100644 --- a/Linphone/view/Control/Display/Contact/ContactListView.qml +++ b/Linphone/view/Control/Display/Contact/ContactListView.qml @@ -56,6 +56,8 @@ ListView { cacheBuffer: 400 implicitHeight: contentHeight spacing: expanded ? Math.round(4 * DefaultStyle.dp) : 0 + + onVisibleChanged: if (visible && !expanded) expanded = true property var _currentItemY: currentItem?.y on_CurrentItemYChanged: if(_currentItemY){ diff --git a/Linphone/view/Control/Display/Sticker.qml b/Linphone/view/Control/Display/Sticker.qml index 6a3f83516..6973506f6 100644 --- a/Linphone/view/Control/Display/Sticker.qml +++ b/Linphone/view/Control/Display/Sticker.qml @@ -202,13 +202,12 @@ Item { triggeredOnStart: true onTriggered: {cameraLoader.reset = !cameraLoader.reset} } - active: mainItem.visible && !mainItem.remoteIsPaused - && mainItem.callState != LinphoneEnums.CallState.End - && mainItem.callState != LinphoneEnums.CallState.Released - && mainItem.callState != LinphoneEnums.CallState.Paused - && mainItem.callState != LinphoneEnums.CallState.PausedByRemote - && mainItem.videoEnabled && !cameraLoader.reset - onActiveChanged: console.log("("+mainItem.qmlName+") Camera active " + active +", visible="+mainItem.visible +", videoEnabled="+mainItem.videoEnabled +", reset="+cameraLoader.reset) + active: mainItem.visible && !mainItem.remoteIsPaused + && mainItem.videoEnabled + && mainItem.callState !== LinphoneEnums.CallState.End + && mainItem.callState !== LinphoneEnums.CallState.Released + && !cameraLoader.reset + onActiveChanged: console.log("("+mainItem.qmlName+") Camera active " + active +", visible="+mainItem.visible +", videoEnabled="+mainItem.videoEnabled +", reset="+cameraLoader.reset) sourceComponent: cameraComponent } Component{ diff --git a/Linphone/view/Page/Form/Contact/ContactEdition.qml b/Linphone/view/Page/Form/Contact/ContactEdition.qml index 63c6f681b..def43e716 100644 --- a/Linphone/view/Page/Form/Contact/ContactEdition.qml +++ b/Linphone/view/Page/Form/Contact/ContactEdition.qml @@ -164,9 +164,17 @@ MainRightPanel { ] content: Flickable { id: editionLayout - contentWidth: Math.round(421 * DefaultStyle.dp) + contentWidth: Math.round(Math.min(parent.width, 421 * DefaultStyle.dp)) + width: parent.width contentY: 0 + MouseArea { + anchors.fill: parent + onClicked: { + editionLayout.forceActiveFocus() + } + } + signal ensureVisibleRequested(Item item) function ensureVisible(r) {