use origin/align methods

This commit is contained in:
i do not exist 2026-07-10 18:24:56 +03:00
parent d8a767326c
commit ae75019d97
4 changed files with 104 additions and 109 deletions

View file

@ -99,12 +99,12 @@ impl MidiEditor {
(clip.color, clip.name.clone(), clip.length, clip.looped)
} else { (ItemTheme::G[64], String::new().into(), 0, false) };
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(),
east(button_2("f2", "name ", false), fg(Rgb(255, 255, 255), format!("{name} "))
.origin_e().full_w()).origin_w().full_w(),
east(button_2("l", "ength ", false), fg(Rgb(255, 255, 255), format!("{length} ")).origin_e().full_w())
.origin_w().full_w(),
east(button_2("r", "epeat ", false), fg(Rgb(255, 255, 255), format!("{looped} ")).origin_e().full_w())
.origin_w().full_w(),
).exact_w(20)
}
pub fn edit_status (&self) -> impl Draw<Tui> + '_ {
@ -119,15 +119,12 @@ impl MidiEditor {
let note_pos = format!("{:>3}", note_pos);
let note_len = format!("{:>4}", self.get_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(),
east(button_2("t", "ime ", false),
fg(Rgb(255, 255, 255), format!("{length} /{time_zoom} +{time_pos} ")).origin_e().full_w()).origin_w().full_w(),
east(button_2("z", "lock ", false),
fg(Rgb(255, 255, 255), format!("{time_lock}")).origin_e().full_w()).origin_w().full_w(),
east(button_2("x", "note ", false),
fg(Rgb(255, 255, 255), format!("{note_name} {note_pos} {note_len}")).origin_e().full_w()).origin_w().full_w(),
).exact_w(20)
}
}