allow selecting button in modal

This commit is contained in:
🪞👃🪞 2025-04-04 16:46:03 +03:00
parent 2e072cb51c
commit 1d1fc483ba
4 changed files with 37 additions and 15 deletions

View file

@ -8,10 +8,17 @@ impl Taggart {
self.mode = Some(Mode::Quit { value: 1 })
}
}
pub fn mode_quit (&mut self, event: &Event) {
pub fn mode_quit (&mut self, event: &Event, value: u8) {
match event {
press!(Esc) => { self.mode = None },
_ => todo!()
press!(Left) => { self.mode = Some(Mode::Quit {
value: value.overflowing_sub(1).0.min(2)
}) },
press!(Right) => { self.mode = Some(Mode::Quit {
value: (value + 1) % 3
}) },
press!(Enter) => todo!(),
_ => {}
}
}
}