2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 07:35:12 +00:00

Close archive by escape even if chat is shown.

This commit is contained in:
John Preston
2019-05-01 16:09:16 +04:00
parent edf4180d11
commit 4ad8c4877c
6 changed files with 48 additions and 47 deletions

View File

@@ -199,7 +199,7 @@ Widget::Widget(QWidget *parent, not_null<Window::Controller*> controller)
controller->openFolder(folder);
}
if (openSearchResult && !session().supportMode()) {
onCancel();
escape();
}
}, lifetime());
@@ -214,7 +214,7 @@ Widget::Widget(QWidget *parent, not_null<Window::Controller*> controller)
}, lifetime());
connect(_filter, &Ui::FlatInput::cancelled, [=] {
onCancel();
escape();
});
connect(_filter, &Ui::FlatInput::changed, [=] {
applyFilterUpdate();
@@ -643,12 +643,10 @@ void Widget::animationCallback() {
}
}
void Widget::onCancel() {
void Widget::escape() {
if (controller()->openedFolder().current()) {
controller()->closeFolder();
return;
}
if (!onCancelSearch()
} else if (!onCancelSearch()
|| (!_searchInChat && !App::main()->selectingPeer())) {
emit cancelled();
}