Skip to content

Commit 87f0d8c

Browse files
committed
Set 'Start' gui button as default, so it is activated by pressing Enter
1 parent cae28f0 commit 87f0d8c

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

docs/development.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ Notes:
9898
9999
- Someday:
100100
101-
- Give focus to the "Decode" or "Resample" button so they are activated by
102-
the Enter key.
103-
104101
- Use new Rust `async` syntax.
105102
106103
- Show telemetry bands on GUI.

src/decode.glade

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
<property name="visible">True</property>
6464
<property name="can_focus">True</property>
6565
<property name="hexpand">True</property>
66+
<property name="activates_default">True</property>
6667
<property name="secondary_icon_stock">gtk-save-as</property>
6768
</object>
6869
<packing>
@@ -190,11 +191,11 @@
190191
</child>
191192
<child>
192193
<object class="GtkCheckButton" id="rotate_image_check">
193-
<property name="label" translatable="yes">Rotate output image (South -> North passes)</property>
194+
<property name="label" translatable="yes">Rotate output image (South -&gt; North passes)</property>
194195
<property name="visible">True</property>
195196
<property name="can_focus">True</property>
196197
<property name="receives_default">False</property>
197-
<property name="tooltip_text" translatable="yes">Enable for ascending (South -> North) satellite passes.</property>
198+
<property name="tooltip_text" translatable="yes">Enable for ascending (South -&gt; North) satellite passes.</property>
198199
<property name="image_position">right</property>
199200
<property name="draw_indicator">True</property>
200201
</object>
@@ -249,6 +250,8 @@
249250
<property name="visible">True</property>
250251
<property name="sensitive">False</property>
251252
<property name="can_focus">True</property>
253+
<property name="can_default">True</property>
254+
<property name="has_default">True</property>
252255
<property name="receives_default">True</property>
253256
<property name="image">start_button_image</property>
254257
<property name="image_position">right</property>

src/gui.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,10 @@ fn build_ui(
328328
}
329329
widgets.start_button.set_sensitive(true);
330330

331+
// Set start button as default, so when the user presses the enter key this
332+
// button will be pressed
333+
widgets.start_button.grab_default();
334+
331335
// Set timezone if on timestamp mode
332336
if let Some(label) = widgets.timezone_label.as_ref() {
333337
// Create any chrono::DateTime from chrono::Local, then ignore the

src/resample.glade

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
<property name="visible">True</property>
6969
<property name="can_focus">True</property>
7070
<property name="hexpand">True</property>
71+
<property name="activates_default">True</property>
7172
<property name="secondary_icon_stock">gtk-save-as</property>
7273
</object>
7374
<packing>
@@ -91,6 +92,7 @@
9192
<object class="GtkSpinButton" id="rate_spinner">
9293
<property name="visible">True</property>
9394
<property name="can_focus">True</property>
95+
<property name="activates_default">True</property>
9496
<property name="text" translatable="yes">11025</property>
9597
<property name="adjustment">rate_adjustment</property>
9698
<property name="numeric">True</property>
@@ -206,6 +208,8 @@
206208
<property name="visible">True</property>
207209
<property name="sensitive">False</property>
208210
<property name="can_focus">True</property>
211+
<property name="can_default">True</property>
212+
<property name="has_default">True</property>
209213
<property name="receives_default">True</property>
210214
<property name="image">start_button_image</property>
211215
<property name="image_position">right</property>

0 commit comments

Comments
 (0)