Project: opening a comp brings up its Composition panel (#90)

Opening a comp (Project double-click, Open Composition, a Timeline tab)
now reopens the Composition panel if it was closed and brings it (and
the Timeline) to the front, as in After Effects. A closed Composition
panel also reopens in the centre (with the Layer panel or other viewers,
else above the Timeline) instead of beside Effects & Presets, which also
fixes Window > Composition.

App::raise_panel opens/fronts a panel without moving the focus;
show_panel builds on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit adf2c6dac78ce426ea0bf6b4199b7238d8ad99dd)
This commit is contained in:
Brandon Thomas
2026-10-06 11:34:27 -04:00
parent a46ebf4dc7
commit aa31ffc2fb
3 changed files with 145 additions and 10 deletions
+5 -3
View File
@@ -192,10 +192,12 @@ pub fn on_open_comp(app: &mut EffectcraftApp, comp: ItemId) {
};
}
app.ui.viewers.insert(app.ui.active_viewer, Some(comp.0));
// The comp's viewer and its Timeline tab come to the front (unless locked).
// The comp's viewer and its Timeline tab come to the front (unless locked), reopened if they
// were closed (as in After Effects).
for p in [active_panel(app), PanelKind::Timeline] {
if !app.ui.locked_tabs.contains(&p.id()) {
app.ui.dock.activate(p);
let closed = !app.ui.dock.contains(p) && !app.ui.floating.iter().any(|f| f.panels.contains(&p));
if closed || !app.ui.locked_tabs.contains(&p.id()) {
app.raise_panel(p);
}
}
}