can't believe this one worked

This commit is contained in:
🪞👃🪞 2025-01-05 23:21:56 +01:00
parent 3dd8a7bc0d
commit a702170d16

View file

@ -11,13 +11,10 @@ render!(TuiOut: (self: PoolView<'a>) => {
let item_height = 1;
let item_offset = i as u16 * item_height;
let selected = i == model.phrase_index();
let offset = |a|Push::y(item_offset, Align::n(Fixed::y(item_height, Fill::x(a))));
let MidiClip { ref name, color, length, .. } = *clip.read().unwrap();
let name = if *compact { format!(" {i:>3}") } else { format!(" {i:>3} {name}") };
let length = if *compact { String::default() } else { format!("{length} ") };
offset(Tui::bg(if selected { color.light.rgb } else { color.base.rgb }, lay!(
map_south(item_offset, item_height, Tui::bg(if selected { color.light.rgb } else { color.base.rgb }, lay!(
Align::w(Tui::fg(color.lightest.rgb, Tui::bold(selected, name))),
Align::e(Tui::fg(color.lightest.rgb, Tui::bold(selected, length))),
Align::w(When(selected, Tui::bold(true, Tui::fg(TuiTheme::g(255), "")))),