mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
wip: ArrangerStandalone
This commit is contained in:
parent
1104093395
commit
3cbb2d2e0b
19 changed files with 165 additions and 231 deletions
|
|
@ -1,30 +1,15 @@
|
|||
use crate::*;
|
||||
|
||||
handle!(Arranger |self, e| {
|
||||
if let Some(modal) = self.modal.as_mut() {
|
||||
let result = modal.handle(e)?;
|
||||
if modal.exited() {
|
||||
self.modal = None;
|
||||
}
|
||||
Ok(result)
|
||||
} else {
|
||||
match e {
|
||||
AppEvent::Input(Event::Key(k)) => {
|
||||
if k.code == KeyCode::Tab {
|
||||
self.focus_sequencer = !self.focus_sequencer;
|
||||
Ok(true)
|
||||
} else if self.focus_sequencer {
|
||||
if let Some(sequencer) = self.sequencer_mut() {
|
||||
handle_keymap(sequencer, e, KEYMAP_SEQUENCER)
|
||||
} else {
|
||||
Ok(false)
|
||||
}
|
||||
} else {
|
||||
handle_keymap(self, e, KEYMAP_ARRANGER)
|
||||
}
|
||||
},
|
||||
_ => Ok(false),
|
||||
}
|
||||
match self.modal.as_mut() {
|
||||
Some(modal) => {
|
||||
let result = modal.handle(e)?;
|
||||
if modal.exited() {
|
||||
self.modal = None;
|
||||
}
|
||||
Ok(result)
|
||||
},
|
||||
None => handle_keymap(self, e, KEYMAP_ARRANGER)
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue