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

View file

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

View file

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