mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
wip: fixing the modal
This commit is contained in:
parent
29f11b5977
commit
2adf0028c3
5 changed files with 57 additions and 69 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue