wip: focus refactor, e13

This commit is contained in:
🪞👃🪞 2024-11-22 02:25:41 +01:00
parent 364769a2e0
commit 6127aa4b30
9 changed files with 110 additions and 65 deletions

View file

@ -34,11 +34,8 @@ pub enum SequencerCommand {
Editor(PhraseCommand),
}
impl<T> Command<T> for SequencerCommand
where
T: ClockApi + PhrasesControl + PhraseEditorControl + FocusGrid<Item = SequencerFocus>
{
fn execute (self, state: &mut T) -> Perhaps<Self> {
impl Command<SequencerTui> for SequencerCommand {
fn execute (self, state: &mut SequencerTui) -> Perhaps<Self> {
use SequencerCommand::*;
Ok(match self {
Focus(cmd) => cmd.execute(state)?.map(Focus),
@ -258,7 +255,7 @@ pub enum PhraseCommand {
TimeZoomSet(usize),
}
impl<T: PhraseEditorControl> Command<T> for PhraseCommand {
impl<T: PhraseEditorControl + HasEnter> Command<T> for PhraseCommand {
fn execute (self, state: &mut T) -> Perhaps<Self> {
use PhraseCommand::*;
Ok(match self {