summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-18 23:08:30 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-18 23:08:30 +0100
commite0866f30d25abd62fadb4b29fff90143c288e9ff (patch)
tree8e482e9d549e6bed4f6843d103b39c2591cb92d8 /gui
parentee7a635a4c2222b8a77f26956dadcd9d515536a7 (diff)
logic: change relative translation triggering
Relative translation mode now has three states: - disabled - always enabled - enabled when not aiming In the third mode, looking very close to center disables reltrans. The exact values aren't final.
Diffstat (limited to 'gui')
-rw-r--r--gui/settings-dialog.ui89
-rw-r--r--gui/settings.cpp23
2 files changed, 77 insertions, 35 deletions
diff --git a/gui/settings-dialog.ui b/gui/settings-dialog.ui
index 363edb3a..20a1b524 100644
--- a/gui/settings-dialog.ui
+++ b/gui/settings-dialog.ui
@@ -1785,13 +1785,47 @@
</widget>
</item>
<item>
- <widget class="QCheckBox" name="tcomp_enable">
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="text">
- <string>Enable</string>
- </property>
+ <widget class="QWidget" name="widget" native="true">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label_17">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>10</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Mode</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="reltrans_mode">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
+ <horstretch>4</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <item>
+ <property name="text">
+ <string>Disabled</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Enabled</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Enabled when not aiming</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
<item>
@@ -1825,7 +1859,7 @@
<number>0</number>
</property>
<item row="2" column="0">
- <widget class="QCheckBox" name="tcomp_tx_disable">
+ <widget class="QCheckBox" name="tcomp_ty_disable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
<horstretch>3</horstretch>
@@ -1836,12 +1870,12 @@
<string notr="true"/>
</property>
<property name="text">
- <string>Disable for X</string>
+ <string>Disable for Y</string>
</property>
</widget>
</item>
- <item row="3" column="0">
- <widget class="QCheckBox" name="tcomp_ty_disable">
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="tcomp_tx_disable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
<horstretch>3</horstretch>
@@ -1852,40 +1886,40 @@
<string notr="true"/>
</property>
<property name="text">
- <string>Disable for Y</string>
+ <string>Disable for X</string>
</property>
</widget>
</item>
- <item row="4" column="0">
- <widget class="QCheckBox" name="tcomp_tz_disable">
+ <item row="3" column="1">
+ <widget class="QCheckBox" name="tcomp_src_roll_disable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
- <horstretch>3</horstretch>
+ <horstretch>2</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
<property name="text">
- <string>Disable for Z (for zoom on Z axis)</string>
+ <string>Disable effect by roll</string>
</property>
</widget>
</item>
- <item row="2" column="1">
- <widget class="QCheckBox" name="tcomp_src_yaw_disable">
+ <item row="3" column="0">
+ <widget class="QCheckBox" name="tcomp_tz_disable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
- <horstretch>2</horstretch>
+ <horstretch>3</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
<property name="text">
- <string>Disable effect by yaw</string>
+ <string>Disable for Z (for zoom on Z axis)</string>
</property>
</widget>
</item>
- <item row="3" column="1">
+ <item row="2" column="1">
<widget class="QCheckBox" name="tcomp_src_pitch_disable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
@@ -1898,8 +1932,8 @@
</property>
</widget>
</item>
- <item row="4" column="1">
- <widget class="QCheckBox" name="tcomp_src_roll_disable">
+ <item row="1" column="1">
+ <widget class="QCheckBox" name="tcomp_src_yaw_disable">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
<horstretch>2</horstretch>
@@ -1907,7 +1941,7 @@
</sizepolicy>
</property>
<property name="text">
- <string>Disable effect by roll</string>
+ <string>Disable effect by yaw</string>
</property>
</widget>
</item>
@@ -2147,7 +2181,6 @@
<tabstop>src_z</tabstop>
<tabstop>invert_z</tabstop>
<tabstop>tracklogging_enabled</tabstop>
- <tabstop>tcomp_enable</tabstop>
<tabstop>tcomp_tx_disable</tabstop>
<tabstop>tcomp_ty_disable</tabstop>
<tabstop>tcomp_tz_disable</tabstop>
diff --git a/gui/settings.cpp b/gui/settings.cpp
index fe0b3261..fc7cde19 100644
--- a/gui/settings.cpp
+++ b/gui/settings.cpp
@@ -54,15 +54,24 @@ options_dialog::options_dialog(std::function<void(bool)> pause_keybindings) :
tie_setting(main.center_at_startup, ui.center_at_startup);
- tie_setting(main.tcomp_p, ui.tcomp_enable);
+ const reltrans_state reltrans_modes[] = {
+ reltrans_disabled,
+ reltrans_enabled,
+ reltrans_non_center,
+ };
+
+ for (unsigned k = 0; k < 3; k++)
+ ui.reltrans_mode->setItemData(k, int(reltrans_modes[k]));
+
+ tie_setting(main.reltrans_mode, ui.reltrans_mode);
- tie_setting(main.tcomp_disable_tx, ui.tcomp_tx_disable);
- tie_setting(main.tcomp_disable_ty, ui.tcomp_ty_disable);
- tie_setting(main.tcomp_disable_tz, ui.tcomp_tz_disable);
+ tie_setting(main.reltrans_disable_tx, ui.tcomp_tx_disable);
+ tie_setting(main.reltrans_disable_ty, ui.tcomp_ty_disable);
+ tie_setting(main.reltrans_disable_tz, ui.tcomp_tz_disable);
- tie_setting(main.tcomp_disable_src_yaw, ui.tcomp_src_yaw_disable);
- tie_setting(main.tcomp_disable_src_pitch, ui.tcomp_src_pitch_disable);
- tie_setting(main.tcomp_disable_src_roll, ui.tcomp_src_roll_disable);
+ tie_setting(main.reltrans_disable_src_yaw, ui.tcomp_src_yaw_disable);
+ tie_setting(main.reltrans_disable_src_pitch, ui.tcomp_src_pitch_disable);
+ tie_setting(main.reltrans_disable_src_roll, ui.tcomp_src_roll_disable);
tie_setting(main.neck_z, ui.neck_z);