mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-01 15:15:13 +00:00
[Improvement] Shortcut to jump to date
This commit is contained in:
committed by
Eric Kotato
parent
f5e016d8f6
commit
8d129323f2
@@ -108,6 +108,7 @@ const auto CommandByName = base::flat_map<QString, Command>{
|
|||||||
//
|
//
|
||||||
|
|
||||||
{ qsl("save_draft") , Command::SaveDraft },
|
{ qsl("save_draft") , Command::SaveDraft },
|
||||||
|
{ qsl("jump_to_date") , Command::JumpToDate },
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto CommandNames = base::flat_map<Command, QString>{
|
const auto CommandNames = base::flat_map<Command, QString>{
|
||||||
@@ -156,6 +157,7 @@ const auto CommandNames = base::flat_map<Command, QString>{
|
|||||||
{ Command::ReadChat , u"read_chat"_q },
|
{ Command::ReadChat , u"read_chat"_q },
|
||||||
|
|
||||||
{ Command::SaveDraft , u"save_draft"_q },
|
{ Command::SaveDraft , u"save_draft"_q },
|
||||||
|
{ Command::JumpToDate , u"jump_to_date"_q },
|
||||||
};
|
};
|
||||||
|
|
||||||
class Manager {
|
class Manager {
|
||||||
@@ -428,6 +430,7 @@ void Manager::fillDefaults() {
|
|||||||
|
|
||||||
set(u"ctrl+r"_q, Command::ReadChat);
|
set(u"ctrl+r"_q, Command::ReadChat);
|
||||||
set(u"ctrl+s"_q, Command::SaveDraft);
|
set(u"ctrl+s"_q, Command::SaveDraft);
|
||||||
|
set(u"ctrl+h"_q, Command::JumpToDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Manager::writeDefaultFile() {
|
void Manager::writeDefaultFile() {
|
||||||
|
@@ -75,6 +75,7 @@ enum class Command {
|
|||||||
SupportHistoryForward,
|
SupportHistoryForward,
|
||||||
|
|
||||||
SaveDraft,
|
SaveDraft,
|
||||||
|
JumpToDate,
|
||||||
};
|
};
|
||||||
|
|
||||||
[[maybe_unused]] constexpr auto kShowFolder = {
|
[[maybe_unused]] constexpr auto kShowFolder = {
|
||||||
|
@@ -1964,6 +1964,10 @@ void HistoryWidget::setupShortcuts() {
|
|||||||
toggleMuteUnmute();
|
toggleMuteUnmute();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
request->check(Command::JumpToDate, 1) && request->handle([=] {
|
||||||
|
controller()->showCalendar(Dialogs::Key(_history), QDateTime());
|
||||||
|
return true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
request->check(Command::SaveDraft, 1) && request->handle([=] {
|
request->check(Command::SaveDraft, 1) && request->handle([=] {
|
||||||
saveCloudDraft();
|
saveCloudDraft();
|
||||||
|
Reference in New Issue
Block a user