diff --git a/Telegram/SourceFiles/core/shortcuts.cpp b/Telegram/SourceFiles/core/shortcuts.cpp index e81dcbae3..7862eb4b5 100644 --- a/Telegram/SourceFiles/core/shortcuts.cpp +++ b/Telegram/SourceFiles/core/shortcuts.cpp @@ -110,6 +110,7 @@ const auto CommandByName = base::flat_map{ // { qsl("save_draft") , Command::SaveDraft }, + { qsl("jump_to_date") , Command::JumpToDate }, }; const auto CommandNames = base::flat_map{ @@ -151,6 +152,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 }, }; [[maybe_unused]] constexpr auto kNoValue = { @@ -440,6 +442,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 bb9d00c32..263fdef9c 100644 --- a/Telegram/SourceFiles/core/shortcuts.h +++ b/Telegram/SourceFiles/core/shortcuts.h @@ -78,6 +78,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 d2dc59bfa..597c3536a 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -2047,6 +2047,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();