From daf8d590858d610e9a2702c70399c0d7bb2778ee Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 17 Feb 2015 06:10:13 +0100 Subject: shortcuts: allow customize whether to center on startup Issue: #128 --- facetracknoir/keyboard.ui | 145 ++++++++++++++++++++------------------ facetracknoir/shortcut-dialog.cpp | 2 + opentrack/main-settings.hpp | 4 +- opentrack/tracker.cpp | 2 +- 4 files changed, 82 insertions(+), 71 deletions(-) diff --git a/facetracknoir/keyboard.ui b/facetracknoir/keyboard.ui index 903bb20f..cdfc0657 100644 --- a/facetracknoir/keyboard.ui +++ b/facetracknoir/keyboard.ui @@ -7,7 +7,7 @@ 0 0 461 - 174 + 181 @@ -39,6 +39,45 @@ QFrame::Plain + + + + + 50 + 16777215 + + + + Shift + + + + + + + + 50 + 16777215 + + + + Ctrl + + + + + + + + 50 + 16777215 + + + + Shift + + + @@ -100,24 +139,8 @@ - - - - - 0 - 0 - - - - Center - - - false - - - - - + + 50 @@ -125,7 +148,7 @@ - Shift + Alt @@ -142,8 +165,8 @@ - - + + 50 @@ -151,36 +174,23 @@ - Alt - - - - - - - - 90 - 0 - - - - Select Number - - - QComboBox::InsertAlphabetically + Shift - - - - - 50 - 16777215 - + + + + + 0 + 0 + - Alt + Center + + + false @@ -216,34 +226,24 @@ - - - + + + - 50 - 16777215 + 90 + 0 - - Shift - - - - - - - - 50 - 16777215 - + + Select Number - - Ctrl + + QComboBox::InsertAlphabetically - - + + 50 @@ -251,7 +251,7 @@ - Shift + Alt @@ -274,6 +274,13 @@ + + + + Center at startup + + + diff --git a/facetracknoir/shortcut-dialog.cpp b/facetracknoir/shortcut-dialog.cpp index f2934c15..437365b4 100644 --- a/facetracknoir/shortcut-dialog.cpp +++ b/facetracknoir/shortcut-dialog.cpp @@ -29,6 +29,8 @@ KeyboardShortcutDialog::KeyboardShortcutDialog() tie_setting(s.zero.ctrl, ui.chkZeroCtrl); tie_setting(s.s_main.tray_enabled, ui.trayp); + + tie_setting(s.s_main.center_at_startup, ui.center_at_startup); } void KeyboardShortcutDialog::doOK() { diff --git a/opentrack/main-settings.hpp b/opentrack/main-settings.hpp index def21f31..971e0fba 100644 --- a/opentrack/main-settings.hpp +++ b/opentrack/main-settings.hpp @@ -29,6 +29,7 @@ struct main_settings { value tcomp_p, tcomp_tz; value tray_enabled; value camera_yaw, camera_pitch; + value center_at_startup; main_settings(pbundle b) : b(b), tracker_dll(b, "tracker-dll", ""), @@ -45,6 +46,7 @@ struct main_settings { tcomp_tz(b, "compensate-translation-disable-z-axis", false), tray_enabled(b, "use-system-tray", false), camera_yaw(b, "camera-yaw", 0), - camera_pitch(b, "camera-pitch", 0) + camera_pitch(b, "camera-pitch", 0), + center_at_startup(b, "center-at-startup", true) {} }; diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp index 338c9113..6ce9a75f 100644 --- a/opentrack/tracker.cpp +++ b/opentrack/tracker.cpp @@ -24,7 +24,7 @@ Tracker::Tracker(main_settings& s, Mappings &m, SelectedLibraries &libs) : s(s), m(m), - centerp(true), + centerp(s.center_at_startup), enabledp(true), zero_(false), should_quit(false), -- cgit v1.2.3