diff --git a/Telegram/SourceFiles/core/shortcuts.cpp b/Telegram/SourceFiles/core/shortcuts.cpp index b5eb20e86..9d2601788 100644 --- a/Telegram/SourceFiles/core/shortcuts.cpp +++ b/Telegram/SourceFiles/core/shortcuts.cpp @@ -96,6 +96,7 @@ const auto CommandByName = base::flat_map{ // { qsl("save_draft") , Command::SaveDraft }, + { qsl("jump_to_date") , Command::JumpToDate }, { qsl("pinned_1") , Command::ChatPinned1 }, { qsl("pinned_2") , Command::ChatPinned2 }, @@ -153,6 +154,7 @@ const auto CommandNames = base::flat_map{ { Command::ShowArchive , qsl("show_archive") }, { Command::SaveDraft , qsl("save_draft") }, + { Command::JumpToDate , qsl("jump_to_date") }, { Command::ChatPinned1 , qsl("pinned_1") }, { Command::ChatPinned2 , qsl("pinned_2") }, @@ -410,6 +412,7 @@ void Manager::fillDefaults() { set(qsl("ctrl+9"), Command::ShowArchive); set(qsl("ctrl+s"), Command::SaveDraft); + set(qsl("ctrl+j"), Command::JumpToDate); } void Manager::writeDefaultFile() { diff --git a/Telegram/SourceFiles/core/shortcuts.h b/Telegram/SourceFiles/core/shortcuts.h index fe2595dd3..458aaf0c3 100644 --- a/Telegram/SourceFiles/core/shortcuts.h +++ b/Telegram/SourceFiles/core/shortcuts.h @@ -60,6 +60,7 @@ enum class Command { SupportHistoryForward, SaveDraft, + JumpToDate, }; constexpr auto kShowFolder = { diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index fb77fc32c..d5187d349 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -1644,6 +1644,10 @@ void HistoryWidget::setupShortcuts() { onCloudDraftSave(); return true; }); + request->check(Command::JumpToDate, 1) && request->handle([=] { + controller()->showJumpToDate(Dialogs::Key(_history), QDate()); + return true; + }); } }, lifetime()); }