From cfa2681ba3b8790bfd56cebd16f40cda1af8dc56 Mon Sep 17 00:00:00 2001 From: arabian Date: Sun, 25 Jan 2026 00:00:11 +0300 Subject: [PATCH] feat: enhance file playback controls with shift and ctrl modifiers --- src/gui/draw.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gui/draw.rs b/src/gui/draw.rs index 64688d7..c7f51c2 100644 --- a/src/gui/draw.rs +++ b/src/gui/draw.rs @@ -390,7 +390,18 @@ impl SoundpadGui { let file_button = Button::new(file_button_text).frame(false); let file_button_response = ui.add(file_button); if file_button_response.clicked() { - self.play_file(&entry_path, ui.input(|i| i.modifiers.ctrl)); + ui.input(|i| { + if i.modifiers.ctrl { + self.play_file(&entry_path, true); + } else if i.modifiers.shift + && let Some(last_track) = self.audio_player_state.tracks.last() + { + self.stop(Some(last_track.id)); + self.play_file(&entry_path, true); + } else { + self.play_file(&entry_path, false); + } + }); self.app_state.selected_file = Some(entry_path); } }