convert to layout suffixes

This commit is contained in:
i do not exist 2026-07-07 16:35:52 +03:00
parent 2d64f63741
commit d8a767326c
6 changed files with 245 additions and 230 deletions

View file

@ -98,17 +98,14 @@ 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) };
w_exact(20, south!(
w_full(origin_w(east(
button_2("f2", "name ", false),
w_full(origin_e(fg(Rgb(255, 255, 255), format!("{name} "))))))),
w_full(origin_w(east(
button_2("l", "ength ", false),
w_full(origin_e(fg(Rgb(255, 255, 255), format!("{length} "))))))),
w_full(origin_w(east(
button_2("r", "epeat ", false),
w_full(origin_e(fg(Rgb(255, 255, 255), format!("{looped} "))))))),
))
south!(
origin_w(east(button_2("f2", "name ", false),
origin_e(fg(Rgb(255, 255, 255), format!("{name} "))).full_w())).full_w(),
origin_w(east(button_2("l", "ength ", false),
origin_e(fg(Rgb(255, 255, 255), format!("{length} "))).full_w())).full_w(),
origin_w(east(button_2("r", "epeat ", false),
origin_e(fg(Rgb(255, 255, 255), format!("{looped} "))).full_w())).full_w(),
).exact_w(20)
}
pub fn edit_status (&self) -> impl Draw<Tui> + '_ {
let (_color, length) = if let Some(clip) = self.clip().as_ref().map(|p|p.read().unwrap()) {
@ -121,20 +118,17 @@ 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());
w_exact(20, south!(
w_full(origin_w(east(
button_2("t", "ime ", false),
w_full(origin_e(fg(Rgb(255, 255, 255),
format!("{length} /{time_zoom} +{time_pos} "))))))),
w_full(origin_w(east(
button_2("z", "lock ", false),
w_full(origin_e(fg(Rgb(255, 255, 255),
format!("{time_lock}"))))))),
w_full(origin_w(east(
button_2("x", "note ", false),
w_full(origin_e(fg(Rgb(255, 255, 255),
format!("{note_name} {note_pos} {note_len}"))))))),
))
south!(
origin_w(east(button_2("t", "ime ", false),
origin_e(fg(Rgb(255, 255, 255),
format!("{length} /{time_zoom} +{time_pos} "))).full_w())).full_w(),
origin_w(east(button_2("z", "lock ", false),
origin_e(fg(Rgb(255, 255, 255),
format!("{time_lock}"))).full_w())).full_w(),
origin_w(east(button_2("x", "note ", false),
origin_e(fg(Rgb(255, 255, 255),
format!("{note_name} {note_pos} {note_len}"))).full_w())).full_w(),
).exact_w(20)
}
}