mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
refactor(transport): make widgets focusable
This commit is contained in:
parent
2106a7c044
commit
b8ac83b019
9 changed files with 204 additions and 132 deletions
|
|
@ -95,11 +95,25 @@ impl Render for ArrangerStandalone {
|
|||
impl Handle for ArrangerStandalone {
|
||||
fn handle (&mut self, e: &AppEvent) -> Usually<bool> {
|
||||
match e {
|
||||
AppEvent::Input(Event::Key(KeyEvent { code: KeyCode::Tab, .. })) => {
|
||||
AppEvent::Input(Event::Key(KeyEvent {
|
||||
code: KeyCode::Char(' '), ..
|
||||
})) => {
|
||||
if let Some(ref mut transport) = self.transport {
|
||||
transport.toggle_play()?;
|
||||
Ok(true)
|
||||
} else {
|
||||
Ok(false)
|
||||
}
|
||||
},
|
||||
AppEvent::Input(Event::Key(KeyEvent {
|
||||
code: KeyCode::Tab, ..
|
||||
})) => {
|
||||
self.focus_next();
|
||||
Ok(true)
|
||||
},
|
||||
AppEvent::Input(Event::Key(KeyEvent { code: KeyCode::BackTab, .. })) => {
|
||||
AppEvent::Input(Event::Key(KeyEvent {
|
||||
code: KeyCode::BackTab, ..
|
||||
})) => {
|
||||
self.focus_prev();
|
||||
Ok(true)
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue