style editor stats as commands

This commit is contained in:
🪞👃🪞 2025-05-17 21:50:14 +03:00
parent 2858b01bd4
commit 9fcb5a08c6
3 changed files with 60 additions and 62 deletions

View file

@ -13,9 +13,15 @@ impl MidiEditor {
(clip.color, clip.name.clone(), clip.length, clip.looped)
} else { (ItemTheme::G[64], String::new().into(), 0, false) };
Fixed::x(20, col!(
Fill::x(Align::w(Bsp::e(" Clip ", format!("{name}")))),
Fill::x(Align::w(Bsp::e(" Length ", format!("{length}")))),
Fill::x(Align::w(Bsp::e(" Loop ", looped.to_string()))),
Fill::x(Align::w(Bsp::e(
button_2("f2", "name ", false),
Fill::x(Align::e(Tui::fg(Rgb(255, 255, 255), format!("{name} "))))))),
Fill::x(Align::w(Bsp::e(
button_2("l", "ength ", false),
Fill::x(Align::e(Tui::fg(Rgb(255, 255, 255), format!("{length} "))))))),
Fill::x(Align::w(Bsp::e(
button_2("r", "epeat ", false),
Fill::x(Align::e(Tui::fg(Rgb(255, 255, 255), format!("{looped} "))))))),
))
}
@ -31,9 +37,18 @@ impl MidiEditor {
let note_pos = format!("{:>3}", note_pos);
let note_len = format!("{:>4}", self.get_note_len());
Fixed::x(20, col!(
Fill::x(Align::w(Bsp::e(" Time ", format!("{length}/{time_zoom}+{time_pos}")))),
Fill::x(Align::w(Bsp::e(" Lock ", format!("{time_lock}")))),
Fill::x(Align::w(Bsp::e(" Note ", format!("{note_name} {note_pos} {note_len}")))),
Fill::x(Align::w(Bsp::e(
button_2("t", "ime ", false),
Fill::x(Align::e(Tui::fg(Rgb(255, 255, 255),
format!("{length} /{time_zoom} +{time_pos} "))))))),
Fill::x(Align::w(Bsp::e(
button_2("z", "lock ", false),
Fill::x(Align::e(Tui::fg(Rgb(255, 255, 255),
format!("{time_lock}"))))))),
Fill::x(Align::w(Bsp::e(
button_2("x", "note ", false),
Fill::x(Align::e(Tui::fg(Rgb(255, 255, 255),
format!("{note_name} {note_pos} {note_len}"))))))),
))
}