sorta working simplified focus!

This commit is contained in:
🪞👃🪞 2024-08-31 21:50:13 +03:00
parent 777904cb35
commit 9f358f8a21
5 changed files with 47 additions and 121 deletions

View file

@ -15,7 +15,7 @@ struct ArrangerStandalone {
/// This allows the sequencer view to be moved or hidden.
show_sequencer: Option<tek_core::Direction>,
///
focus: usize,
focus: usize,
}
impl ArrangerStandalone {
@ -23,7 +23,7 @@ impl ArrangerStandalone {
self.focus = if self.focus > 0 { 1 } else { self.focus - 1 };
}
fn focus_next (&mut self) {
self.focus = if self.focus < 2 { self.focus + 1 } else { 0 };
self.focus = if self.focus < 1 { self.focus + 1 } else { 0 };
}
fn focused (&self) -> &dyn Render {
self.focusable()[self.focus]
@ -107,6 +107,7 @@ impl Render for ArrangerStandalone {
.add_ref(&self.transport)
.add_ref(&self.arranger)
.add_ref(&sequencer)
.focus(Some(self.focus))
.render(buf, area)?;
if let Some(ref modal) = self.arranger.modal {
fill_bg(buf, area, Nord::bg_lo(false, false));