add modal overlay

This commit is contained in:
🪞👃🪞 2025-04-04 00:07:47 +03:00
parent f571b079b1
commit 1c4991c51b
2 changed files with 24 additions and 2 deletions

View file

@ -5,6 +5,8 @@ impl Taggart {
todo!()
}
pub fn save_begin (&mut self) {
self.mode = Some(Mode::Save { value: false })
if self.tasks.len() > 0 {
self.mode = Some(Mode::Save { value: false })
}
}
}

View file

@ -1,5 +1,5 @@
use crate::*;
pub(crate) use tengri::tui::ratatui::style::Color;//, Style}, prelude::Stylize};
pub(crate) use tengri::tui::ratatui::style::{Color, Modifier};
pub(crate) use pad::PadStr;
mod table; pub use self::table::*;
@ -26,6 +26,26 @@ impl Content<TuiOut> for Taggart {
let sized = |x|Bsp::b(sizer, Fill::xy(x));
value_bar(mode_bar(title_bar(sized(TreeTable(self)))))
}
fn render (&self, to: &mut TuiOut) {
self.content().render(to);
match self.mode {
Some(Mode::Save { value }) => {
to.tint_all(
Color::Rgb(96,96,96),
Color::Rgb(48,48,48),
Modifier::DIM
)
},
Some(Mode::Quit { value }) => {
to.tint_all(
Color::Rgb(96,96,96),
Color::Rgb(48,48,48),
Modifier::DIM
)
},
_ => {},
}
}
}
impl Taggart {