mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-07 10:06:44 +01:00
stub help modal; cleanup
This commit is contained in:
parent
b157a87647
commit
4619d0ea76
9 changed files with 78 additions and 68 deletions
|
|
@ -1,21 +1,16 @@
|
|||
use crate::*;
|
||||
|
||||
impl Taggart {
|
||||
pub fn save_begin (&mut self) {
|
||||
if self.tasks.len() > 0 {
|
||||
self.mode = Some(Mode::Save { value: 1 })
|
||||
}
|
||||
}
|
||||
pub fn mode_save (&mut self, event: &Event, value: u8) {
|
||||
pub fn handle_save (&mut self, event: &Event, choice: u8) {
|
||||
match event {
|
||||
press!(Esc) => { self.mode = None }
|
||||
press!(Left) => { self.mode = Some(Mode::Save {
|
||||
value: value.overflowing_sub(1).0.min(2)
|
||||
choice: choice.overflowing_sub(1).0.min(2)
|
||||
}) },
|
||||
press!(Right) => { self.mode = Some(Mode::Save {
|
||||
value: (value + 1) % 3
|
||||
choice: (choice + 1) % 3
|
||||
}) },
|
||||
press!(Enter) => match value {
|
||||
press!(Enter) => match choice {
|
||||
0 => { self.tasks = vec![]; self.mode = None; },
|
||||
1 => { self.mode = None },
|
||||
2 => todo!(),
|
||||
|
|
@ -24,4 +19,9 @@ impl Taggart {
|
|||
_ => {}
|
||||
}
|
||||
}
|
||||
pub fn save_begin (&mut self) {
|
||||
if self.tasks.len() > 0 {
|
||||
self.mode = Some(Mode::Save { choice: 1 })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue