mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-06 17:46:42 +01:00
allow selecting button in modal
This commit is contained in:
parent
2e072cb51c
commit
1d1fc483ba
4 changed files with 37 additions and 15 deletions
|
|
@ -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!(),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue