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
This commit is contained in:
gaelle 2025-04-15 16:53:34 +02:00
parent 06d6af29c7
commit 844ab4ecbb
7 changed files with 32 additions and 15 deletions

View file

@ -129,7 +129,7 @@ void CallList::setSelf(QSharedPointer<CallList> 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);

View file

@ -130,10 +130,10 @@ std::shared_ptr<linphone::Friend> 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<linphone::Friend> 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

View file

@ -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)

View file

@ -24,5 +24,11 @@ ColumnLayout {
color: mainItem.panelColor
Layout.fillWidth: true
Layout.fillHeight: true
MouseArea {
anchors.fill: parent
onClicked: {
rightPanelContent.forceActiveFocus()
}
}
}
}

View file

@ -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){

View file

@ -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{

View file

@ -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) {