mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-07 18:16:42 +01:00
allow exiting from modals; add buttons
This commit is contained in:
parent
a4ee3d2912
commit
2e072cb51c
6 changed files with 81 additions and 68 deletions
|
|
@ -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!()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue