force focusing chat search bar when research done (otherwise focus is lost if chat previsouly focused becomes invisible) #LINQT-2377

This commit is contained in:
Gaelle Braud 2026-03-18 16:12:36 +01:00
parent 49bc5de54e
commit 5bb9c1a6a4
2 changed files with 10 additions and 0 deletions

View file

@ -37,10 +37,15 @@ ListView {
signal markAllAsRead()
signal chatClicked(ChatGui chat)
property bool makingResearch: false
signal researchDone()
onResearchDone: makingResearch = false
model: ChatProxy {
id: chatProxy
filterText: mainItem.searchText
onFilterTextChanged: {
mainItem.makingResearch = true
chatToSelectLater = currentChatGui
}
onModelAboutToBeReset: {
@ -58,6 +63,7 @@ ListView {
} else {
selectChat(mainItem.currentChatGui)
}
mainItem.researchDone()
}
onChatAdded: (chat) => {
mainItem.chatToSelect = chat

View file

@ -227,6 +227,10 @@ AbstractMainPage {
searchBar: searchBar
Control.ScrollBar.vertical: scrollbar
onResearchDone: {
searchBar.forceActiveFocus()
}
onCurrentChatGuiChanged: {
mainItem.selectedChatGui = currentChatGui
}