summaryrefslogtreecommitdiffhomepage
path: root/variant/default/main-window.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-07-02 08:27:59 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-07-02 09:34:17 +0200
commitb50e107d8971f47e9d3aa90f44551de44328142b (patch)
tree8770b1c91e47c6d86cabc46e50a6901a7ec7619a /variant/default/main-window.cpp
parentf2faf7acf4445fef2a149ebbdecb569a2d119d94 (diff)
opentrack/main-window: use more aggregate initialization
This is new in C++17, cf. P0017R1.
Diffstat (limited to 'variant/default/main-window.cpp')
-rw-r--r--variant/default/main-window.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/variant/default/main-window.cpp b/variant/default/main-window.cpp
index 8e5cd10c..b653f139 100644
--- a/variant/default/main-window.cpp
+++ b/variant/default/main-window.cpp
@@ -322,25 +322,19 @@ void main_window::init_tray()
void main_window::register_shortcuts()
{
- using t_key = Shortcuts::t_key;
- using t_keys = Shortcuts::t_keys;
+ global_shortcuts.reload({
+ { s.key_start_tracking1, [this](bool) { start_tracker(); }, true },
+ { s.key_start_tracking2, [this](bool) { start_tracker(); }, true },
- t_keys keys
- {
- t_key(s.key_start_tracking1, [this](bool) { start_tracker(); }, true),
- t_key(s.key_start_tracking2, [this](bool) { start_tracker(); }, true),
-
- t_key(s.key_stop_tracking1, [this](bool) { stop_tracker(); }, true),
- t_key(s.key_stop_tracking2, [this](bool) { stop_tracker(); }, true),
+ { s.key_stop_tracking1, [this](bool) { stop_tracker(); }, true },
+ { s.key_stop_tracking2, [this](bool) { stop_tracker(); }, true },
- t_key(s.key_toggle_tracking1, [this](bool) { toggle_tracker(); }, true),
- t_key(s.key_toggle_tracking2, [this](bool) { toggle_tracker(); }, true),
+ { s.key_toggle_tracking1, [this](bool) { toggle_tracker(); }, true },
+ { s.key_toggle_tracking2, [this](bool) { toggle_tracker(); }, true },
- t_key(s.key_restart_tracking1, [this](bool) { restart_tracker(); }, true),
- t_key(s.key_restart_tracking2, [this](bool) { restart_tracker(); }, true),
- };
-
- global_shortcuts.reload(keys);
+ { s.key_restart_tracking1, [this](bool) { restart_tracker(); }, true },
+ { s.key_restart_tracking2, [this](bool) { restart_tracker(); }, true },
+ });
if (work)
work->reload_shortcuts();