mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-03 21:54:05 +02:00
Added shortcut to open chat preview from dialogs.
This commit is contained in:
parent
7197d9480b
commit
9682e37547
5 changed files with 13 additions and 0 deletions
|
@ -681,6 +681,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"lng_shortcuts_archive_chat" = "Archive chat";
|
||||
"lng_shortcuts_media_fullscreen" = "Toggle video fullscreen";
|
||||
"lng_shortcuts_show_chat_menu" = "Show chat menu";
|
||||
"lng_shortcuts_show_chat_preview" = "Show chat preview";
|
||||
|
||||
"lng_settings_chat_reactions_title" = "Quick Reaction";
|
||||
"lng_settings_chat_reactions_subtitle" = "Choose your favorite reaction";
|
||||
|
|
|
@ -110,6 +110,7 @@ const auto CommandByName = base::flat_map<QString, Command>{
|
|||
{ u"read_chat"_q , Command::ReadChat },
|
||||
|
||||
{ u"show_chat_menu"_q , Command::ShowChatMenu },
|
||||
{ u"show_chat_preview"_q , Command::ShowChatPreview },
|
||||
|
||||
// Shortcuts that have no default values.
|
||||
{ u"message"_q , Command::JustSendMessage },
|
||||
|
@ -506,6 +507,7 @@ void Manager::fillDefaults() {
|
|||
set(u"ctrl+r"_q, Command::ReadChat);
|
||||
|
||||
set(u"ctrl+\\"_q, Command::ShowChatMenu);
|
||||
set(u"ctrl+]"_q, Command::ShowChatPreview);
|
||||
|
||||
_defaults = keysCurrents();
|
||||
}
|
||||
|
|
|
@ -72,6 +72,7 @@ enum class Command {
|
|||
MediaViewerFullscreen,
|
||||
|
||||
ShowChatMenu,
|
||||
ShowChatPreview,
|
||||
|
||||
SupportReloadTemplates,
|
||||
SupportToggleMuted,
|
||||
|
|
|
@ -1314,6 +1314,14 @@ void Widget::setupShortcuts() {
|
|||
}
|
||||
return true;
|
||||
});
|
||||
request->check(Command::ShowChatPreview, 1)
|
||||
&& request->handle([=] {
|
||||
if (_inner) {
|
||||
Window::ActivateWindow(controller());
|
||||
return _inner->showChatPreview();
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}, lifetime());
|
||||
}
|
||||
|
|
|
@ -98,6 +98,7 @@ struct Labeled {
|
|||
{ C::ArchiveChat, tr::lng_shortcuts_archive_chat() },
|
||||
{ C::ShowScheduled, tr::lng_shortcuts_scheduled() },
|
||||
{ C::ShowChatMenu, tr::lng_shortcuts_show_chat_menu() },
|
||||
{ C::ShowChatPreview, tr::lng_shortcuts_show_chat_preview() },
|
||||
separator,
|
||||
{ C::JustSendMessage, tr::lng_shortcuts_just_send() },
|
||||
{ C::SendSilentMessage, tr::lng_shortcuts_silent_send() },
|
||||
|
|
Loading…
Add table
Reference in a new issue