Activate the chosen default folder on Escape.

This commit is contained in:
John Preston 2022-09-14 09:13:28 +04:00
parent 02daa2a04b
commit d81b2fbb69
1 changed files with 8 additions and 2 deletions

View File

@ -48,6 +48,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_histories.h"
#include "data/data_changes.h"
#include "data/data_download_manager.h"
#include "data/data_chat_filters.h"
#include "info/downloads/info_downloads_widget.h"
#include "info/info_memento.h"
#include "facades.h"
@ -854,8 +855,13 @@ void Widget::escape() {
} else if (!cancelSearch()) {
if (controller()->activeChatEntryCurrent().key) {
controller()->content()->dialogsCancelled();
} else if (controller()->activeChatsFilterCurrent()) {
controller()->setActiveChatsFilter(FilterId(0));
} else {
const auto filters = &session().data().chatsFilters();
const auto &list = filters->list();
const auto first = list.empty() ? FilterId() : list.front().id();
if (controller()->activeChatsFilterCurrent() != first) {
controller()->setActiveChatsFilter(first);
}
}
} else if (!_searchInChat && !controller()->selectingPeer()) {
if (controller()->activeChatEntryCurrent().key) {