mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
whew! refactor complete
This commit is contained in:
parent
deaa66d6e2
commit
685ccfaf49
7 changed files with 58 additions and 58 deletions
|
|
@ -104,32 +104,32 @@ impl Handle<Tui> for ArrangerStandalone<Tui> {
|
|||
}
|
||||
},
|
||||
key!(KeyCode::Tab) => {
|
||||
self.arranger.focus_next();
|
||||
self.focus_next();
|
||||
Ok(Some(true))
|
||||
},
|
||||
key!(KeyCode::BackTab) => {
|
||||
self.arranger.focus_prev();
|
||||
self.focus_prev();
|
||||
Ok(Some(true))
|
||||
},
|
||||
key!(KeyCode::Down) => {
|
||||
if self.focus == 0 || (
|
||||
self.focus == 1 && self.arranger.is_last_row()
|
||||
) {
|
||||
self.arranger.focus_next();
|
||||
self.focus_next();
|
||||
Ok(Some(true))
|
||||
} else {
|
||||
self.arranger.focused_mut().handle(from)
|
||||
self.focused_mut().handle(from)
|
||||
}
|
||||
},
|
||||
key!(KeyCode::Up) => {
|
||||
if self.focus == 1 && self.arranger.is_first_row() {
|
||||
self.arranger.focus_prev();
|
||||
self.focus_prev();
|
||||
Ok(Some(true))
|
||||
} else {
|
||||
self.arranger.focused_mut().handle(from)
|
||||
self.focused_mut().handle(from)
|
||||
}
|
||||
},
|
||||
_ => self.arranger.focused_mut().handle(from)
|
||||
_ => self.focused_mut().handle(from)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -142,23 +142,23 @@ impl Handle<Tui> for SequencerProxy<Tui> {
|
|||
}
|
||||
}
|
||||
|
||||
impl Focus<2, E: Engine> for ArrangerStandalone<E> {
|
||||
impl Focus<2, Tui> for ArrangerStandalone<Tui> {
|
||||
fn focus (&self) -> usize {
|
||||
self.focus
|
||||
}
|
||||
fn focus_mut (&mut self) -> &mut usize {
|
||||
&mut self.focus
|
||||
}
|
||||
fn focusable (&self) -> [&dyn Focusable<E>;2] {
|
||||
fn focusable (&self) -> [&dyn Focusable<Tui>;2] {
|
||||
[
|
||||
&self.transport as &dyn Focusable<E>,
|
||||
&self.arranger as &dyn Focusable<E>,
|
||||
&self.transport as &dyn Focusable<Tui>,
|
||||
&self.arranger as &dyn Focusable<Tui>,
|
||||
]
|
||||
}
|
||||
fn focusable_mut (&mut self) -> [&mut dyn Focusable<E>;2] {
|
||||
fn focusable_mut (&mut self) -> [&mut dyn Focusable<Tui>;2] {
|
||||
[
|
||||
&mut self.transport as &mut dyn Focusable<E>,
|
||||
&mut self.arranger as &mut dyn Focusable<E>,
|
||||
&mut self.transport as &mut dyn Focusable<Tui>,
|
||||
&mut self.arranger as &mut dyn Focusable<Tui>,
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
include!("lib.rs");
|
||||
/// Application entrypoint.
|
||||
pub fn main () -> Usually<()> {
|
||||
run(TransportToolbar::standalone()?)?;
|
||||
Tui::run(TransportToolbar::standalone()?)?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue