mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-11 22:26:44 +01:00
cmdsys: handle entered areas
This commit is contained in:
parent
31c1db8a5c
commit
1085826849
4 changed files with 65 additions and 24 deletions
|
|
@ -11,8 +11,18 @@ impl Content for Sequencer<Tui> {
|
|||
}
|
||||
}
|
||||
impl Handle<Tui> for Sequencer<Tui> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
if let Some(command) = SequencerCommand::match_input(self, from) {
|
||||
fn handle (&mut self, i: &TuiInput) -> Perhaps<bool> {
|
||||
if let Some(entered) = self.entered() {
|
||||
use SequencerFocus::*;
|
||||
if let Some(true) = match entered {
|
||||
Transport => self.transport.as_mut().map(|t|t.handle(i)).transpose()?.flatten(),
|
||||
PhrasePool => self.phrases.write().unwrap().handle(i)?,
|
||||
PhraseEditor => self.editor.handle(i)?,
|
||||
} {
|
||||
return Ok(Some(true))
|
||||
}
|
||||
}
|
||||
if let Some(command) = SequencerCommand::match_input(self, i) {
|
||||
let _undo = command.execute(self)?;
|
||||
return Ok(Some(true))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue