reenable most arranger components

This commit is contained in:
i do not exist 2026-08-08 23:37:25 +03:00
parent 4aefaf452c
commit 68236a7210
4 changed files with 152 additions and 125 deletions

View file

@ -609,9 +609,15 @@ impl Track {
pub fn per <'a, T: Draw<Tui> + 'a, U: TracksSizes<'a>> (
tracks: impl Fn() -> U + Send + Sync + 'a,
callback: impl Fn(usize, &'a Track)->T + Send + Sync + 'a
callback: &'a (impl Fn(usize, &'a Track)->T + Send + Sync + 'a)
) -> impl Draw<Tui> + 'a {
view_track_per(tracks, callback)
iter_east(move||tracks().map(|(index, track, x1, x2): (usize, &Track, usize, usize)|{
fg_bg(
track.color.lightest.term,
track.color.base.term,
callback(index, track)
).exact_w((x2 - x1) as u16)
}))
}
}
@ -948,10 +954,11 @@ impl Arrangement {
pub fn view_track_devices (&self, theme: ItemTheme) -> impl Draw<Tui> {
let height = self.devices_height();
view_track_row_section(theme,
button_3("d", "evice", format!("{}", self.track().map(|t|t.devices.len()).unwrap_or(0)), false),
button_2("D", "+", false),
iter_once(self.tracks_with_sizes(), move|(_, track, _x1, _x2), index|bg(
let btn1 = button_3("d", "evice", format!("{}", self.track().map(|t|t.devices.len()).unwrap_or(0)), false);
let btn2 = button_2("D", "+", false);
view_track_row_section(theme, btn1, btn2, iter_east(move||self.tracks_with_sizes()
.enumerate()
.map(move|(index, (_, track, _x1, _x2))|bg(
track.color.dark.term,
iter_south(move||(0..height).map(|_|fg_bg(
ItemTheme::G[32].lightest.term,
@ -963,7 +970,7 @@ impl Arrangement {
.exact_wh(
Some(track_width(index, track)),
Some(height + 1),
)))
))))
}
fn devices_height (&self) -> u16 {