diff --git a/Telegram/SourceFiles/core/shortcuts.cpp b/Telegram/SourceFiles/core/shortcuts.cpp index 03bd7c893..0b261aab3 100644 --- a/Telegram/SourceFiles/core/shortcuts.cpp +++ b/Telegram/SourceFiles/core/shortcuts.cpp @@ -99,6 +99,7 @@ const auto CommandByName = base::flat_map{ // { qsl("save_draft") , Command::SaveDraft }, + { qsl("jump_to_date") , Command::JumpToDate }, }; const auto CommandNames = base::flat_map{ @@ -140,6 +141,7 @@ const auto CommandNames = base::flat_map{ { Command::ReadChat , qsl("read_chat") }, { Command::SaveDraft , qsl("save_draft") }, + { Command::JumpToDate , qsl("jump_to_date") }, }; class Manager { @@ -393,6 +395,7 @@ void Manager::fillDefaults() { set(qsl("ctrl+r"), Command::ReadChat); set(qsl("ctrl+s"), Command::SaveDraft); + set(qsl("ctrl+h"), Command::JumpToDate); } void Manager::writeDefaultFile() { diff --git a/Telegram/SourceFiles/core/shortcuts.h b/Telegram/SourceFiles/core/shortcuts.h index fd614db15..606763246 100644 --- a/Telegram/SourceFiles/core/shortcuts.h +++ b/Telegram/SourceFiles/core/shortcuts.h @@ -63,6 +63,7 @@ enum class Command { SupportHistoryForward, SaveDraft, + JumpToDate, }; [[maybe_unused]] constexpr auto kShowFolder = { diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 0f9104d77..917406dec 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -1962,6 +1962,10 @@ void HistoryWidget::setupShortcuts() { saveCloudDraft(); return true; }); + request->check(Command::JumpToDate, 1) && request->handle([=] { + controller()->showCalendar(Dialogs::Key(_history), QDateTime()); + return true; + }); } }, lifetime()); }