diff options
author | crupest <crupest@outlook.com> | 2020-10-28 16:58:56 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-10-28 16:58:56 +0800 |
commit | 2df47ffbfff02fb6b64d19e404adc41a93677afe (patch) | |
tree | e15a566c95b68b6266bdcab14bba64be729ab300 /src/ui/ShortcutHub.cpp | |
parent | fde24556042b76863bdec34dcc213cb7298f68f9 (diff) | |
download | cru-2df47ffbfff02fb6b64d19e404adc41a93677afe.tar.gz cru-2df47ffbfff02fb6b64d19e404adc41a93677afe.tar.bz2 cru-2df47ffbfff02fb6b64d19e404adc41a93677afe.zip |
...
Diffstat (limited to 'src/ui/ShortcutHub.cpp')
-rw-r--r-- | src/ui/ShortcutHub.cpp | 8 |
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; } |