open editor

This commit is contained in:
i do not exist 2026-09-23 06:22:18 +03:00
parent fdee3fbfc8
commit 6aff4e55a6
6 changed files with 212 additions and 303 deletions

View file

@ -400,7 +400,7 @@ impl<T: HasScene
}
}
impl<T: HasEditor
impl<T: HasClip + HasEditor
+ Namespace<u32>
+ Namespace<f64>
+ Namespace<bool>
@ -409,7 +409,7 @@ impl<T: HasEditor
+ Namespace<ClipSlot>
> MidiEditControl for T {}
#[tek_proc::commands(MidiEditCmd)] pub trait MidiEditControl: HasEditor
#[tek_proc::commands(MidiEditCmd)] pub trait MidiEditControl: HasClip + HasEditor
+ Namespace<u32>
+ Namespace<f64>
+ Namespace<bool>
@ -420,8 +420,16 @@ impl<T: HasEditor
#[command(Toggle = "toggle")] fn edit_toggle (&mut self) -> Perhaps<MidiEditCmd> {
if self.is_editing() {
*self.editor_mut() = None;
} else {
todo!()
} else if let Some(clip) = self.clip() {
let editor = MidiEditor {
mode: Default::default(),
size: Sizer(
Arc::new(0usize.into()),
Arc::new(0usize.into()),
),
};
*editor.mode.clip.0.write() = clip.clone();
*self.editor_mut() = Some(editor);
}
Ok(Some(MidiEditCmd::Toggle))
}