[Improvement] Shortcut to jump to date
This commit is contained in:
parent
a12e6e56bf
commit
39fadee372
3 changed files with 8 additions and 0 deletions
|
|
@ -99,6 +99,7 @@ const auto CommandByName = base::flat_map<QString, Command>{
|
|||
//
|
||||
|
||||
{ qsl("save_draft") , Command::SaveDraft },
|
||||
{ qsl("jump_to_date") , Command::JumpToDate },
|
||||
};
|
||||
|
||||
const auto CommandNames = base::flat_map<Command, QString>{
|
||||
|
|
@ -140,6 +141,7 @@ const auto CommandNames = base::flat_map<Command, QString>{
|
|||
{ 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() {
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ enum class Command {
|
|||
SupportHistoryForward,
|
||||
|
||||
SaveDraft,
|
||||
JumpToDate,
|
||||
};
|
||||
|
||||
[[maybe_unused]] constexpr auto kShowFolder = {
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue