mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-08 02:26:42 +01:00
implement non-save options in modals
This commit is contained in:
parent
ef0213003a
commit
72607e482c
3 changed files with 14 additions and 4 deletions
|
|
@ -8,7 +8,7 @@ impl Taggart {
|
|||
self.mode = Some(Mode::Quit { value: 1 })
|
||||
}
|
||||
}
|
||||
pub fn mode_quit (&mut self, event: &Event, value: u8) {
|
||||
pub fn mode_quit (&mut self, input: &TuiIn, event: &Event, value: u8) {
|
||||
match event {
|
||||
press!(Esc) => { self.mode = None },
|
||||
press!(Left) => { self.mode = Some(Mode::Quit {
|
||||
|
|
@ -17,7 +17,12 @@ impl Taggart {
|
|||
press!(Right) => { self.mode = Some(Mode::Quit {
|
||||
value: (value + 1) % 3
|
||||
}) },
|
||||
press!(Enter) => todo!(),
|
||||
press!(Enter) => match value {
|
||||
0 => { input.done() },
|
||||
1 => { self.mode = None },
|
||||
2 => todo!(),
|
||||
_ => unreachable!(),
|
||||
},
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,12 @@ impl Taggart {
|
|||
press!(Right) => { self.mode = Some(Mode::Save {
|
||||
value: (value + 1) % 3
|
||||
}) },
|
||||
press!(Enter) => todo!(),
|
||||
press!(Enter) => match value {
|
||||
0 => { self.tasks = vec![]; self.mode = None; },
|
||||
1 => { self.mode = None },
|
||||
2 => todo!(),
|
||||
_ => unreachable!(),
|
||||
},
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue