tengri 0.5.0, rudimentary modals

This commit is contained in:
🪞👃🪞 2025-04-04 00:35:26 +03:00
parent 1c4991c51b
commit a4ee3d2912
3 changed files with 23 additions and 11 deletions

View file

@ -34,14 +34,26 @@ impl Content<TuiOut> for Taggart {
Color::Rgb(96,96,96),
Color::Rgb(48,48,48),
Modifier::DIM
)
);
let message = format!("You have {} unsaved change(s)", self.tasks.len());
let modal = Fill::xy(Align::c(Tui::modify(false, Modifier::DIM, Tui::fg_bg(
Color::Rgb(255,255,255),
Color::Rgb(0, 0, 0),
Expand::xy(2, 2, "Save?")))));
Content::render(&modal, to)
},
Some(Mode::Quit { value }) => {
to.tint_all(
Color::Rgb(96,96,96),
Color::Rgb(48,48,48),
Modifier::DIM
)
);
let message = format!("You have {} unsaved change(s)", self.tasks.len());
let modal = Fill::xy(Align::c(Tui::modify(false, Modifier::DIM, Tui::fg_bg(
Color::Rgb(255,255,255),
Color::Rgb(0, 0, 0),
Expand::xy(2, 2, "Save?")))));
Content::render(&modal, to)
},
_ => {},
}