2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +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

@@ -386,7 +386,16 @@ MainWidget::MainWidget(
connect(_dialogs, SIGNAL(cancelled()), this, SLOT(dialogsCancelled()));
connect(this, SIGNAL(dialogsUpdated()), _dialogs, SLOT(onListScroll()));
connect(_history, &HistoryWidget::cancelled, [=] {
_dialogs->setInnerFocus();
const auto historyFromFolder = _history->history()
? _history->history()->folder()
: nullptr;
const auto openedFolder = controller->openedFolder().current();
if (!openedFolder || historyFromFolder == openedFolder) {
controller->showBackFromStack();
_dialogs->setInnerFocus();
} else {
controller->closeFolder();
}
});
subscribe(
Media::Player::instance()->updatedNotifier(),