mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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()) {
|
if (controller()->isPrimary()) {
|
||||||
controller()->content()->searchInChat(_history);
|
controller()->content()->searchInChat(_history);
|
||||||
} else {
|
} else {
|
||||||
const auto update = [=] {
|
const auto search = [=] {
|
||||||
updateControlsVisibility();
|
const auto update = [=] {
|
||||||
updateBotKeyboard();
|
updateControlsVisibility();
|
||||||
updateFieldPlaceholder();
|
updateBotKeyboard();
|
||||||
|
updateFieldPlaceholder();
|
||||||
|
|
||||||
updateControlsGeometry();
|
updateControlsGeometry();
|
||||||
};
|
};
|
||||||
_composeSearch = std::make_unique<HistoryView::ComposeSearch>(
|
_composeSearch = std::make_unique<HistoryView::ComposeSearch>(
|
||||||
this,
|
this,
|
||||||
controller(),
|
controller(),
|
||||||
_history);
|
_history);
|
||||||
|
|
||||||
update();
|
|
||||||
setInnerFocus();
|
|
||||||
_composeSearch->destroyRequests(
|
|
||||||
) | rpl::take(
|
|
||||||
1
|
|
||||||
) | rpl::start_with_next([=] {
|
|
||||||
_composeSearch = nullptr;
|
|
||||||
|
|
||||||
update();
|
update();
|
||||||
setInnerFocus();
|
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