[chronojump] Encoder feedback buttons for tactile devices
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Encoder feedback buttons for tactile devices
- Date: Mon, 15 Jul 2019 11:15:34 +0000 (UTC)
commit 799593702267e3ae7ddea94117f4dac3c577d0a0
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Jul 15 13:15:15 2019 +0200
Encoder feedback buttons for tactile devices
glade/repetitive_conditions.glade | 212 +++++++++++++++++++++++++++++---------
src/gui/repetitiveConditions.cs | 21 ++++
2 files changed, 185 insertions(+), 48 deletions(-)
---
diff --git a/glade/repetitive_conditions.glade b/glade/repetitive_conditions.glade
index e341f0e6..aa4aef5f 100644
--- a/glade/repetitive_conditions.glade
+++ b/glade/repetitive_conditions.glade
@@ -1777,15 +1777,15 @@
<property name="column_spacing">10</property>
<property name="row_spacing">6</property>
<child>
- <widget class="GtkHBox" id="hbox33">
+ <widget class="GtkHBox" id="hbox35">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">10</property>
<child>
- <widget class="GtkLabel" id="label8">
+ <widget class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label">>=</property>
+ <property name="label"><=</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -1794,19 +1794,43 @@
</packing>
</child>
<child>
- <widget class="GtkSpinButton"
id="spinbutton_encoder_automatic_greater">
+ <widget class="GtkHBox" id="hbox45">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
- <property name="adjustment">90 10 100 1 1 0</property>
- <property name="climb_rate">10</property>
- <property name="snap_to_ticks">True</property>
- <property name="numeric">True</property>
- <signal name="value_changed"
handler="on_spinbutton_encoder_automatic_greater_value_changed" swapped="no"/>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkSpinButton"
id="spinbutton_encoder_automatic_lower">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property
name="primary_icon_activatable">False</property>
+ <property
name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">70 10 100 1 1 0</property>
+ <property name="climb_rate">10</property>
+ <property name="snap_to_ticks">True</property>
+ <property name="numeric">True</property>
+ <signal name="value_changed"
handler="on_spinbutton_encoder_automatic_lower_value_changed" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label12">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">%</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -1815,19 +1839,53 @@
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label7">
+ <widget class="GtkHBox" id="hbox47">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label">%</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkButton"
id="button_encoder_automatic_lower_minus_1">
+ <property name="label"> -1 </property>
+ <property name="width_request">40</property>
+ <property name="height_request">40</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <signal name="clicked"
handler="on_button_encoder_automatic_lower_minus_1_clicked" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton"
id="button_encoder_automatic_lower_plus_1">
+ <property name="label"> +1 </property>
+ <property name="width_request">40</property>
+ <property name="height_request">40</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <signal name="clicked"
handler="on_button_encoder_automatic_lower_plus_1_clicked" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton"
id="checkbutton_encoder_automatic_greater">
+ <widget class="GtkCheckButton"
id="checkbutton_encoder_automatic_lower">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -1835,18 +1893,18 @@
<property name="tooltip" translatable="yes">Bell
bad</property>
<property name="draw_indicator">True</property>
<child>
- <widget class="GtkAlignment" id="alignment19">
+ <widget class="GtkAlignment" id="alignment20">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<child>
- <widget class="GtkHBox" id="hbox34">
+ <widget class="GtkHBox" id="hbox36">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
<child>
- <widget class="GtkImage"
id="image_repetitive_encoder_automatic_greater">
+ <widget class="GtkImage"
id="image_repetitive_encoder_automatic_lower">
<property name="visible">True</property>
<property name="can_focus">False</property>
</widget>
@@ -1870,19 +1928,21 @@
</child>
</widget>
<packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options"/>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox35">
+ <widget class="GtkHBox" id="hbox33">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">10</property>
<child>
- <widget class="GtkLabel" id="label9">
+ <widget class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label"><=</property>
+ <property name="label">>=</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -1891,19 +1951,43 @@
</packing>
</child>
<child>
- <widget class="GtkSpinButton"
id="spinbutton_encoder_automatic_lower">
+ <widget class="GtkHBox" id="hbox44">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
- <property name="adjustment">70 10 100 1 1 0</property>
- <property name="climb_rate">10</property>
- <property name="snap_to_ticks">True</property>
- <property name="numeric">True</property>
- <signal name="value_changed"
handler="on_spinbutton_encoder_automatic_lower_value_changed" swapped="no"/>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkSpinButton"
id="spinbutton_encoder_automatic_greater">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property
name="primary_icon_activatable">False</property>
+ <property
name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">90 10 100 1 1 0</property>
+ <property name="climb_rate">10</property>
+ <property name="snap_to_ticks">True</property>
+ <property name="numeric">True</property>
+ <signal name="value_changed"
handler="on_spinbutton_encoder_automatic_greater_value_changed" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">%</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -1912,19 +1996,53 @@
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label12">
+ <widget class="GtkHBox" id="hbox46">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label">%</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkButton"
id="button_encoder_automatic_greater_minus_1">
+ <property name="label"> -1 </property>
+ <property name="width_request">40</property>
+ <property name="height_request">40</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <signal name="clicked"
handler="on_button_encoder_automatic_greater_minus_1_clicked" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton"
id="button_encoder_automatic_greater_plus_1">
+ <property name="label"> +1 </property>
+ <property name="width_request">40</property>
+ <property name="height_request">40</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <signal name="clicked"
handler="on_button_encoder_automatic_greater_plus_1_clicked" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton"
id="checkbutton_encoder_automatic_lower">
+ <widget class="GtkCheckButton"
id="checkbutton_encoder_automatic_greater">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -1932,18 +2050,18 @@
<property name="tooltip" translatable="yes">Bell
bad</property>
<property name="draw_indicator">True</property>
<child>
- <widget class="GtkAlignment" id="alignment20">
+ <widget class="GtkAlignment" id="alignment19">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<child>
- <widget class="GtkHBox" id="hbox36">
+ <widget class="GtkHBox" id="hbox34">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
<child>
- <widget class="GtkImage"
id="image_repetitive_encoder_automatic_lower">
+ <widget class="GtkImage"
id="image_repetitive_encoder_automatic_greater">
<property name="visible">True</property>
<property name="can_focus">False</property>
</widget>
@@ -1967,8 +2085,6 @@
</child>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
<property name="x_options"/>
</packing>
</child>
diff --git a/src/gui/repetitiveConditions.cs b/src/gui/repetitiveConditions.cs
index 349c58d3..273a37d0 100644
--- a/src/gui/repetitiveConditions.cs
+++ b/src/gui/repetitiveConditions.cs
@@ -114,6 +114,10 @@ public class RepetitiveConditionsWindow
[Widget] Gtk.SpinButton spinbutton_encoder_peakpower_higher;
[Widget] Gtk.SpinButton spinbutton_encoder_power_lower;
[Widget] Gtk.SpinButton spinbutton_encoder_peakpower_lower;
+ [Widget] Gtk.Button button_encoder_automatic_greater_minus_1;
+ [Widget] Gtk.Button button_encoder_automatic_greater_plus_1;
+ [Widget] Gtk.Button button_encoder_automatic_lower_minus_1;
+ [Widget] Gtk.Button button_encoder_automatic_lower_plus_1;
[Widget] Gtk.Button button_test_good;
@@ -498,6 +502,23 @@ public class RepetitiveConditionsWindow
void on_spinbutton_encoder_automatic_lower_value_changed (object o, EventArgs args) {
checkbutton_encoder_automatic_lower.Active = true;
}
+
+ void on_button_encoder_automatic_greater_minus_1_clicked (object o, EventArgs args)
+ {
+ spinbutton_encoder_automatic_greater.Value --;
+ }
+ void on_button_encoder_automatic_greater_plus_1_clicked (object o, EventArgs args)
+ {
+ spinbutton_encoder_automatic_greater.Value ++;
+ }
+ void on_button_encoder_automatic_lower_minus_1_clicked (object o, EventArgs args)
+ {
+ spinbutton_encoder_automatic_lower.Value --;
+ }
+ void on_button_encoder_automatic_lower_plus_1_clicked (object o, EventArgs args)
+ {
+ spinbutton_encoder_automatic_lower.Value ++;
+ }
void on_checkbutton_encoder_show_manual_feedback_toggled (object o, EventArgs args) {
if(checkbutton_encoder_show_manual_feedback.Active)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]