aboutsummaryrefslogtreecommitdiff
path: root/src/ui/ShortcutHub.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-10-28 16:58:56 +0800
committercrupest <crupest@outlook.com>2020-10-28 16:58:56 +0800
commit2df47ffbfff02fb6b64d19e404adc41a93677afe (patch)
treee15a566c95b68b6266bdcab14bba64be729ab300 /src/ui/ShortcutHub.cpp
parentfde24556042b76863bdec34dcc213cb7298f68f9 (diff)
downloadcru-2df47ffbfff02fb6b64d19e404adc41a93677afe.tar.gz
cru-2df47ffbfff02fb6b64d19e404adc41a93677afe.tar.bz2
cru-2df47ffbfff02fb6b64d19e404adc41a93677afe.zip
...
Diffstat (limited to 'src/ui/ShortcutHub.cpp')
-rw-r--r--src/ui/ShortcutHub.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ui/ShortcutHub.cpp b/src/ui/ShortcutHub.cpp
index 145cfa87..c9ce6cdd 100644
--- a/src/ui/ShortcutHub.cpp
+++ b/src/ui/ShortcutHub.cpp
@@ -10,11 +10,11 @@
#include <optional>
namespace cru::ui {
-int ShortcutHub::RegisterShortcut(std::u16string name, ShortcutKeyBind bind,
- std::function<bool()> handler) {
+int ShortcutHub::RegisterShortcut(Shortcut shortcut) {
const int id = current_id_++;
- ShortcutInfo info{id, std::move(name), bind, std::move(handler)};
- map_[bind].push_back(std::move(info));
+ map_[shortcut.key_bind].push_back({id, std::move(shortcut.name),
+ shortcut.key_bind,
+ std::move(shortcut.handler)});
return id;
}