2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Added ability to open folders with shortcuts.

This commit is contained in:
23rd
2020-03-27 20:51:09 +03:00
parent 49e286b04c
commit 09bc3eefdb
3 changed files with 58 additions and 9 deletions

View File

@@ -3034,6 +3034,25 @@ void InnerWidget::setupShortcuts() {
return jumpToDialogRow({ row->key(), FullMsgId() });
});
}
auto &&folders = ranges::view::zip(
Shortcuts::kShowFolder,
ranges::view::ints(0, ranges::unreachable));
for (const auto [command, index] : folders) {
request->check(command) && request->handle([=, index = index] {
const auto list = &session().data().chatsFilters().list();
if (index >= list->size()) {
return false;
}
const auto filterId = list->at(index).id();
_controller->setActiveChatsFilter((filterId == _filterId)
? 0
: filterId);
return true;
});
}
if (session().supportMode() && row.key.history()) {
request->check(
Command::SupportScrollToCurrent