allow exiting from modals; add buttons

This commit is contained in:
🪞👃🪞 2025-04-04 16:32:53 +03:00
parent a4ee3d2912
commit 2e072cb51c
6 changed files with 81 additions and 68 deletions

View file

@ -1,14 +1,17 @@
use crate::*;
impl Taggart {
pub fn mode_quit (&mut self, event: &Event) {
todo!()
}
pub fn quit_begin (&mut self, input: &TuiIn) {
if self.tasks.len() == 0 {
input.done()
} else {
self.mode = Some(Mode::Quit { value: false })
self.mode = Some(Mode::Quit { value: 1 })
}
}
pub fn mode_quit (&mut self, event: &Event) {
match event {
press!(Esc) => { self.mode = None },
_ => todo!()
}
}
}