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

@ -31,7 +31,7 @@ impl<'a> ArrangerVClips<'a> {
Tui::bg(scene.color.base.rgb,
if playing { "" } else { " " }),
Tui::fg_bg(scene.color.lightest.rgb, scene.color.base.rgb,
Tui::grow_x(1, Tui::bold(true, scene.name.read().unwrap().as_str()))),
Grow::x(1, Tui::bold(true, scene.name.read().unwrap().as_str()))),
row!((index, track, x1, x2) in ArrangerTrack::with_widths(tracks) => {
Self::format_clip(scene, index, track, (x2 - x1) as u16, height)
})])
@ -53,7 +53,7 @@ impl<'a> ArrangerVClips<'a> {
}
};
add(&Tui::bg(bg,
Tui::push_x(1, Fixed::w(w, &name.as_str()[0..max_w])))
Push::x(1, Fixed::w(w, &name.as_str()[0..max_w])))
)?;
}
Ok(())

View file

@ -15,7 +15,7 @@ from!(<'a>|state: &'a ArrangerTui|ArrangerVHead<'a> = Self { // A
scenes_w: SCENES_W_OFFSET + ArrangerScene::longest_name(&state.scenes) as u16,
});
render!(<Tui>|self: ArrangerVHead<'a>|Tui::push_x(self.scenes_w, row!(
render!(<Tui>|self: ArrangerVHead<'a>|Push::x(self.scenes_w, row!(
(_, track, x1, x2) in ArrangerTrack::with_widths(self.tracks) => {
let (w, h) = (ArrangerTrack::MIN_WIDTH.max(x2 - x1), HEADER_H);
let color = track.color();
@ -25,7 +25,7 @@ render!(<Tui>|self: ArrangerVHead<'a>|Tui::push_x(self.scenes_w, row!(
Tui::fg(color.lightest.rgb, field)
])
}
Tui::bg(color.base.rgb, Tui::min_xy(w as u16, h, Fixed::wh(w as u16, 5, col!([
Tui::bg(color.base.rgb, Min::xy(w as u16, h, Fixed::wh(w as u16, 5, col!([
row(color, &Self::format_name(track, w)),
row(color, &Self::format_input(track)?),
row(color, &Self::format_output(track)?),