Skip to content

Commit

Permalink
fix(UI): Play/Pause button gets default focus
Browse files Browse the repository at this point in the history
  • Loading branch information
mfep committed Mar 2, 2025
1 parent 5e71fde commit 9a7066d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/training_timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ impl Component for TrainingTimer {
set_label: &model.remaining_str_secs(),
},
},
#[name = "button_box"]
gtk::Box {
set_orientation: gtk::Orientation::Horizontal,
set_halign: gtk::Align::Center,
Expand All @@ -293,6 +294,7 @@ impl Component for TrainingTimer {
// Translators: tooltip text for the reset button
set_tooltip: &gettext("Restart Training"),
},
#[name = "play_pause_button"]
gtk::Button {
set_css_classes: &["circular", "huge-button"],
connect_clicked => TrainingTimerInput::StartStop,
Expand Down Expand Up @@ -361,6 +363,9 @@ impl Component for TrainingTimer {
.first_child()
.unwrap()
.set_css_classes(&["circular", "toggle", "large-button"]);
widgets
.button_box
.set_focus_child(Some(&widgets.play_pause_button));
model.audio_player.emit(AudioPlayerInput::NextWarmup);
ComponentParts { model, widgets }
}
Expand Down

0 comments on commit 9a7066d

Please sign in to comment.