diff --git a/Telegram/SourceFiles/core/shortcuts.cpp b/Telegram/SourceFiles/core/shortcuts.cpp index be3dc7eec..dd0ecee34 100644 --- a/Telegram/SourceFiles/core/shortcuts.cpp +++ b/Telegram/SourceFiles/core/shortcuts.cpp @@ -108,6 +108,7 @@ const auto CommandByName = base::flat_map{ // { qsl("save_draft") , Command::SaveDraft }, + { qsl("jump_to_date") , Command::JumpToDate }, }; const auto CommandNames = base::flat_map{ @@ -156,6 +157,7 @@ const auto CommandNames = base::flat_map{ { Command::ReadChat , u"read_chat"_q }, { Command::SaveDraft , u"save_draft"_q }, + { Command::JumpToDate , u"jump_to_date"_q }, }; class Manager { @@ -428,6 +430,7 @@ void Manager::fillDefaults() { set(u"ctrl+r"_q, Command::ReadChat); set(u"ctrl+s"_q, Command::SaveDraft); + set(u"ctrl+h"_q, Command::JumpToDate); } void Manager::writeDefaultFile() { diff --git a/Telegram/SourceFiles/core/shortcuts.h b/Telegram/SourceFiles/core/shortcuts.h index 5ea469fa1..bb1f82d34 100644 --- a/Telegram/SourceFiles/core/shortcuts.h +++ b/Telegram/SourceFiles/core/shortcuts.h @@ -75,6 +75,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 1287980e6..1687424b2 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -1964,6 +1964,10 @@ void HistoryWidget::setupShortcuts() { toggleMuteUnmute(); return true; }); + request->check(Command::JumpToDate, 1) && request->handle([=] { + controller()->showCalendar(Dialogs::Key(_history), QDateTime()); + return true; + }); } request->check(Command::SaveDraft, 1) && request->handle([=] { saveCloudDraft();