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

Make Ctrl+Shift+[1-6] jump through accounts.

This commit is contained in:
John Preston
2024-01-05 12:50:04 +04:00
parent c257b75a66
commit 28b43eff7c
4 changed files with 66 additions and 6 deletions

View File

@@ -80,6 +80,13 @@ const auto CommandByName = base::flat_map<QString, Command>{
{ u"next_folder"_q , Command::FolderNext },
{ u"all_chats"_q , Command::ShowAllChats },
{ u"account1"_q , Command::ShowAccount1 },
{ u"account2"_q , Command::ShowAccount2 },
{ u"account3"_q , Command::ShowAccount3 },
{ u"account4"_q , Command::ShowAccount4 },
{ u"account5"_q , Command::ShowAccount5 },
{ u"account6"_q , Command::ShowAccount6 },
{ u"folder1"_q , Command::ShowFolder1 },
{ u"folder2"_q , Command::ShowFolder2 },
{ u"folder3"_q , Command::ShowFolder3 },
@@ -392,6 +399,14 @@ void Manager::fillDefaults() {
set(u"%1+%2"_q.arg(ctrl).arg(index), command);
}
auto &&accounts = ranges::views::zip(
kShowAccount,
ranges::views::ints(1, ranges::unreachable));
for (const auto [command, index] : accounts) {
set(u"%1+shift+%2"_q.arg(ctrl).arg(index), command);
}
set(u"%1+shift+down"_q.arg(ctrl), Command::FolderNext);
set(u"%1+shift+up"_q.arg(ctrl), Command::FolderPrevious);

View File

@@ -38,6 +38,13 @@ enum class Command {
ChatPinned7,
ChatPinned8,
ShowAccount1,
ShowAccount2,
ShowAccount3,
ShowAccount4,
ShowAccount5,
ShowAccount6,
ShowAllChats,
ShowFolder1,
ShowFolder2,
@@ -79,6 +86,15 @@ enum class Command {
Command::ShowFolderLast,
};
[[maybe_unused]] constexpr auto kShowAccount = {
Command::ShowAccount1,
Command::ShowAccount2,
Command::ShowAccount3,
Command::ShowAccount4,
Command::ShowAccount5,
Command::ShowAccount6,
};
[[nodiscard]] FnMut<bool()> RequestHandler(Command command);
class Request {