mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 23:27:09 +02:00
Added support of close prevention for search messages in dialogs.
This commit is contained in:
parent
1f4ea8414b
commit
307894415f
1 changed files with 24 additions and 19 deletions
|
@ -4386,29 +4386,34 @@ void HistoryWidget::searchInChat() {
|
|||
if (controller()->isPrimary()) {
|
||||
controller()->content()->searchInChat(_history);
|
||||
} else {
|
||||
const auto update = [=] {
|
||||
updateControlsVisibility();
|
||||
updateBotKeyboard();
|
||||
updateFieldPlaceholder();
|
||||
const auto search = [=] {
|
||||
const auto update = [=] {
|
||||
updateControlsVisibility();
|
||||
updateBotKeyboard();
|
||||
updateFieldPlaceholder();
|
||||
|
||||
updateControlsGeometry();
|
||||
};
|
||||
_composeSearch = std::make_unique<HistoryView::ComposeSearch>(
|
||||
this,
|
||||
controller(),
|
||||
_history);
|
||||
|
||||
update();
|
||||
setInnerFocus();
|
||||
_composeSearch->destroyRequests(
|
||||
) | rpl::take(
|
||||
1
|
||||
) | rpl::start_with_next([=] {
|
||||
_composeSearch = nullptr;
|
||||
updateControlsGeometry();
|
||||
};
|
||||
_composeSearch = std::make_unique<HistoryView::ComposeSearch>(
|
||||
this,
|
||||
controller(),
|
||||
_history);
|
||||
|
||||
update();
|
||||
setInnerFocus();
|
||||
}, _composeSearch->lifetime());
|
||||
_composeSearch->destroyRequests(
|
||||
) | rpl::take(
|
||||
1
|
||||
) | rpl::start_with_next([=] {
|
||||
_composeSearch = nullptr;
|
||||
|
||||
update();
|
||||
setInnerFocus();
|
||||
}, _composeSearch->lifetime());
|
||||
};
|
||||
if (!preventsClose(search)) {
|
||||
search();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue