arranger: editor now toggles

This commit is contained in:
🪞👃🪞 2025-05-17 13:47:07 +03:00
parent b0393184fa
commit 4f3a50f2d6
2 changed files with 18 additions and 11 deletions

View file

@ -19,19 +19,25 @@ handle!(TuiIn: |self: App, input|Ok(if let Some(command) = self.config.keys.comm
#[tengri_proc::command(App)] impl AppCommand {
fn edit (app: &mut App) -> Perhaps<Self> {
app.project.editor = if app.project.editor.is_some() {
None
} else {
let selection = app.selection().clone();
Ok(match selection {
match selection {
Selection::TrackClip { track, scene } => {
let clip = &mut app.scenes_mut()[scene].clips[track];
if clip.is_none() {
//app.clip_auto_create();
*clip = Some(Default::default());
}
app.project.editor = clip.as_ref().map(|c|c.into());
clip.as_ref().map(|c|c.into())
}
_ => {
None
}
_ => None
})
}
};
Ok(None)
}
fn dialog (app: &mut App, dialog: Option<Dialog>) -> Perhaps<Self> {
app.toggle_dialog(dialog);

View file

@ -2,6 +2,7 @@ use crate::*;
impl Content<TuiOut> for Arrangement {
fn content (&self) -> impl Render<TuiOut> {
panic!();
let ins = |x|Bsp::n(self.view_inputs_0(), x);
let tracks = |x|Bsp::s(self.view_tracks_0(), x);
let devices = |x|Bsp::s(self.view_devices_0(), x);