wip: fixing the modal

This commit is contained in:
🪞👃🪞 2024-09-26 03:29:18 +03:00
parent 29f11b5977
commit 2adf0028c3
5 changed files with 57 additions and 69 deletions

View file

@ -410,21 +410,6 @@ pub trait TuiStyle: Widget<Engine = Tui> + Sized {
}
}
impl<W: Widget<Engine = Tui>> TuiStyle for W {}
impl<M: Widget<Engine = Tui>, W: Widget<Engine = Tui>> Widget for ModalHost<Tui, M, W> {
type Engine = Tui;
fn layout (&self, to: [u16;2]) -> Perhaps<[u16;2]> {
Ok(Some(to))
}
fn render (&self, to: &mut TuiOutput) -> Usually<()> {
self.2.render(to)?;
if self.0 {
to.fill_bg(to.area(), COLOR_BG1);
to.fill_fg(to.area(), COLOR_BG2);
self.1.render(to)?;
}
Ok(())
}
}
pub struct Foreground(pub Color);
impl Widget for Foreground {