arranger: add history field
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
🪞👃🪞 2025-05-18 19:18:39 +03:00
parent 7746abc9ee
commit 99d9da6ffd
2 changed files with 25 additions and 18 deletions

View file

@ -8,9 +8,9 @@ impl App {
"nil"
}
pub fn view_history (&self) -> impl Content<TuiOut> {
Fill::x(Align::w(self.history.last()
.map(|last|FieldH(self.color, format!("History ({})", self.history.len()),
Fill::x(Align::w(format!("{:?}", last.0)))))));
Fixed::y(1, Fill::x(Align::w(FieldH(self.color,
format!("History ({})", self.history.len()),
self.history.last().map(|last|Fill::x(Align::w(format!("{:?}", last.0))))))))
}
pub fn view_status_h2 (&self) -> impl Content<TuiOut> + use<'_> {
self.update_clock();
@ -32,7 +32,7 @@ impl App {
add(&" ");
{
let cache = self.view_cache.read().unwrap();
add(&Fixed::x(13, Align::w(Bsp::s(
add(&Fixed::x(15, Align::w(Bsp::s(
FieldH(theme, "Beat", cache.beat.view.clone()),
FieldH(theme, "Time", cache.time.view.clone()),
))));
@ -40,14 +40,22 @@ impl App {
Fill::x(Align::w(FieldH(theme, "BPM", cache.bpm.view.clone()))),
Fill::x(Align::w(FieldH(theme, "SR ", cache.sr.view.clone()))),
))));
add(&Fixed::x(13, Align::w(Bsp::s(
add(&Fixed::x(12, Align::w(Bsp::s(
Fill::x(Align::w(FieldH(theme, "Buf", cache.buf.view.clone()))),
Fill::x(Align::w(FieldH(theme, "Lat", cache.lat.view.clone()))),
))));
add(&Fixed::x(16, FieldV(theme, "Selection", Align::w(self.selection().describe(
self.tracks(),
self.scenes()
)))));
add(&Bsp::s(
Fill::x(Align::w(FieldH(theme, "Selected", Align::w(self.selection().describe(
self.tracks(),
self.scenes()
))))),
Fill::x(Align::w(FieldH(theme, format!("History ({})", self.history.len()),
self.history.last().map(|last|Fill::x(Align::w(format!("{:?}", last.0)))))))
));
//if let Some(last) = self.history.last() {
//add(&FieldV(theme, format!("History ({})", self.history.len()),
//Fill::x(Align::w(format!("{:?}", last.0)))));
//}
}
}))
}