detach all layout constructors from engine

This commit is contained in:
🪞👃🪞 2024-12-30 13:48:51 +01:00
parent 61b447403b
commit e0e680eb7c
19 changed files with 487 additions and 520 deletions

View file

@ -210,7 +210,7 @@ render!(<Tui>|self: PoolView<'a>|{
Tui::bg(bg, lay!(move|add|{
add(&Fill::wh(Outer(Style::default().fg(color.base.rgb).bg(bg))))?;
//add(&Lozenge(Style::default().bg(border_bg).fg(border_color)))?;
add(&Tui::inset_xy(0, 1, Fill::wh(col!(move|add|match mode {
add(&Inset::xy(0, 1, Fill::wh(col!(move|add|match mode {
Some(PoolMode::Import(_, ref file_picker)) => add(file_picker),
Some(PoolMode::Export(_, ref file_picker)) => add(file_picker),
_ => Ok(for (i, phrase) in phrases.iter().enumerate() {
@ -226,7 +226,7 @@ render!(<Tui>|self: PoolView<'a>|{
add(&Tui::bg(color.base.rgb, Fill::w(col!([
Fill::w(lay!(|add|{
add(&Fill::w(Align::w(format!(" {i}"))))?;
add(&Fill::w(Align::e(Tui::pull_x(1, length.clone()))))
add(&Fill::w(Align::e(Pull::x(1, length.clone()))))
})),
Tui::bold(true, {
let mut row2 = format!(" {name}");
@ -245,8 +245,8 @@ render!(<Tui>|self: PoolView<'a>|{
}))?;
})
}))))?;
add(&Fill::w(Align::nw(Tui::push_x(1, Tui::fg(title_color, upper_left.to_string())))))?;
add(&Fill::w(Align::ne(Tui::pull_x(1, Tui::fg(title_color, upper_right.to_string())))))?;
add(&Fill::w(Align::nw(Push::x(1, Tui::fg(title_color, upper_left.to_string())))))?;
add(&Fill::w(Align::ne(Pull::x(1, Tui::fg(title_color, upper_right.to_string())))))?;
add(&self.0.size)
}))
});