separate render/content macros; add has_jack

This commit is contained in:
🪞👃🪞 2025-01-14 12:41:27 +01:00
parent 08184f9906
commit e62e36d558
19 changed files with 183 additions and 226 deletions

View file

@ -27,7 +27,7 @@ impl SamplerTui {
None
}
}
render!(TuiOut: (self: SamplerTui) => {
content!(TuiOut: |self: SamplerTui| {
let keys_width = 5;
let keys = move||"";//SamplerKeys(self);
let fg = self.color.base.rgb;
@ -54,8 +54,8 @@ struct SamplesTui {
note_pt: usize,
height: usize,
}
render!(TuiOut: |self: SamplesTui, render|{
let x = render.area.x();
render!(TuiOut: |self: SamplesTui, to| {
let x = to.area.x();
let bg_base = self.color.darkest.rgb;
let bg_selected = self.color.darker.rgb;
let style_empty = Style::default().fg(self.color.base.rgb);
@ -64,7 +64,7 @@ render!(TuiOut: |self: SamplesTui, render|{
let note = self.note_hi - y as usize;
let bg = if note == self.note_pt { bg_selected } else { bg_base };
let style = Some(style_empty.bg(bg));
render.blit(&" (no sample) ", x, render.area.y() + y as u16, style);
to.blit(&" (no sample) ", x, to.area.y() + y as u16, style);
}
});
impl NoteRange for SamplerTui {