Added ability to open contacts with shortcut.

Fixed #8775.
This commit is contained in:
23rd 2020-10-07 21:06:22 +03:00 committed by John Preston
parent 367b028094
commit 7de9bcad03
3 changed files with 9 additions and 0 deletions

View File

@ -88,6 +88,7 @@ const auto CommandByName = base::flat_map<QString, Command>{
{ qsl("last_folder") , Command::ShowFolderLast },
{ qsl("show_archive") , Command::ShowArchive },
{ qsl("show_contacts") , Command::ShowContacts },
{ qsl("read_chat") , Command::ReadChat },
@ -132,6 +133,7 @@ const auto CommandNames = base::flat_map<Command, QString>{
{ Command::ShowFolderLast , qsl("last_folder") },
{ Command::ShowArchive , qsl("show_archive") },
{ Command::ShowContacts , qsl("show_contacts") },
{ Command::ReadChat , qsl("read_chat") },
};
@ -383,6 +385,7 @@ void Manager::fillDefaults() {
set(qsl("ctrl+0"), Command::ChatSelf);
set(qsl("ctrl+9"), Command::ShowArchive);
set(qsl("ctrl+shift+n"), Command::ShowContacts);
set(qsl("ctrl+r"), Command::ReadChat);
}

View File

@ -48,6 +48,7 @@ enum class Command {
FolderPrevious,
ShowArchive,
ShowContacts,
JustSendMessage,
SendSilentMessage,

View File

@ -3178,6 +3178,11 @@ void InnerWidget::setupShortcuts() {
return (history != nullptr);
});
request->check(Command::ShowContacts) && request->handle([=] {
Ui::show(PrepareContactsBox(_controller));
return true;
});
if (session().supportMode() && row.key.history()) {
request->check(
Command::SupportScrollToCurrent