groovebox: spiffy sidebar

This commit is contained in:
🪞👃🪞 2025-05-14 20:19:44 +03:00
parent 0f16c89248
commit d45bd2122e
6 changed files with 137 additions and 44 deletions

View file

@ -12,10 +12,11 @@ impl MidiEditor {
let (color, name, length, looped) = if let Some(clip) = self.clip().as_ref().map(|p|p.read().unwrap()) {
(clip.color, clip.name.clone(), clip.length, clip.looped)
} else { (ItemTheme::G[64], String::new().into(), 0, false) };
Bsp::e(
FieldH(color, "Edit", format!("{name} ({length})")),
FieldH(color, "Loop", looped.to_string())
)
Fixed::x(20, col!(
Fill::x(Align::w(FieldV(color, "Clip ", format!("{name}")))),
Fill::x(Align::w(FieldH(color, "Length", format!("{length}")))),
Fill::x(Align::w(FieldH(color, "Loop ", looped.to_string()))),
))
}
pub fn edit_status (&self) -> impl Content<TuiOut> + '_ {
@ -29,10 +30,10 @@ impl MidiEditor {
let note_name = format!("{:4}", Note::pitch_to_name(note_pos));
let note_pos = format!("{:>3}", note_pos);
let note_len = format!("{:>4}", self.get_note_len());
Bsp::e(
FieldH(color, "Time", format!("{length}/{time_zoom}+{time_pos} {time_lock}")),
FieldH(color, "Note", format!("{note_name} {note_pos} {note_len}")),
)
Fixed::x(20, Bsp::s(
Fill::x(Align::w(FieldH(color, "Time", format!("{length}/{time_zoom}+{time_pos} {time_lock}")))),
Fill::x(Align::w(FieldH(color, "Note", format!("{note_name} {note_pos} {note_len}")))),
))
}
}