impl TuiTheme on Tui; need to to reduce number of ItemPalette invocations

This commit is contained in:
🪞👃🪞 2025-01-19 22:09:37 +01:00
parent 9d250daa04
commit cfa3cad5cb
9 changed files with 157 additions and 177 deletions

View file

@ -37,7 +37,7 @@ pub trait HasPlayClip: HasClock {
let MidiClip { ref name, color, .. } = *clip.read().unwrap();
(name.clone(), color)
} else {
("".into(), TuiTheme::g(64).into())
("".into(), Tui::g(64).into())
};
let time: String = self.pulses_since_start_looped()
.map(|(times, time)|format!("{:>3}x {:>}", times+1.0, self.clock().timebase.format_beats_1(time)))
@ -47,7 +47,7 @@ pub trait HasPlayClip: HasClock {
fn next_status (&self) -> impl Content<TuiOut> {
let mut time: Arc<str> = String::from("--.-.--").into();
let mut name: Arc<str> = String::from("").into();
let mut color = ItemPalette::from(TuiTheme::g(64));
let mut color = ItemPalette::from(Tui::g(64));
let clock = self.clock();
if let Some((t, Some(clip))) = self.next_clip() {
let clip = clip.read().unwrap();