From 6079a2ee068d5678246ec5e9b852c22dbcfc2cb8 Mon Sep 17 00:00:00 2001 From: arnav-hiwarkar Date: Thu, 12 Nov 2026 18:33:27 +0530 Subject: [PATCH] #2869: disclose effects only while Effect Controls is drawn Decide visibility from the panels drawn last frame instead of re-deriving the maximize rule: a maximized frame shows its front tab, which may be Effect Controls, and hides floating windows. Leave arrows to viewer text editing. --- crates/ui-egui/src/lib.rs | 4 ++-- crates/ui-egui/src/panels/effect_controls/panel.rs | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 1558ce743..cd0ac4307 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -409,8 +409,8 @@ pub struct EffectcraftApp { applied_prefs: Option<(u64, Option)>, /// A previous run that didn't exit cleanly (shown by `Dialog::Recovery`). pub recovery: Option, - /// Docked groups laid out last frame: (active panel, group rect) — `~` maximizes the one - /// under the pointer. + /// Panels drawn last frame, docked and floating: (panel, body rect). `~` maximizes the one + /// under the pointer; Effect Controls' arrow keys work only while it is on screen. pub(crate) dock_rects: Vec<(PanelKind, egui::Rect)>, /// The floating panels' OS windows that drew a panel last frame; one that is gone releases /// its IME state. diff --git a/crates/ui-egui/src/panels/effect_controls/panel.rs b/crates/ui-egui/src/panels/effect_controls/panel.rs index 45c3d2e33..1904600df 100644 --- a/crates/ui-egui/src/panels/effect_controls/panel.rs +++ b/crates/ui-egui/src/panels/effect_controls/panel.rs @@ -4,13 +4,17 @@ use super::rows::{FxScope, group_rows, toggle_closed}; use super::{Align2, Color32, EffectcraftApp, EvalCtx, GroupKind, Icon, Layer, PropGroup, Rect, Sense, Stroke, Tokens, json, pos2, vec2, widgets}; use crate::dock::{PanelKind, WorkspaceExt as _}; -/// Plain Left/Right disclose selected effect headers before global layer nudges run. +/// Plain Right / Left Arrow expand / collapse the selected effects, as in After Effects, before +/// the arrows' layer nudge runs. Only while Effect Controls has the focus and is on screen: the +/// front tab of its frame, drawn last frame (a maximized frame hides every other frame and every +/// floating window), not behind Home. With no effect header selected the arrows still nudge. pub(crate) fn handle_disclosure_key(app: &mut EffectcraftApp, key: egui::Key) -> bool { let panel = PanelKind::EffectControls; if app.ui.focused != panel || app.ui.start_screen + || app.session.state.text_edit.is_some() || !app.ui.dock.is_visible(panel) - || (app.ui.dock.is_docked(panel) && app.ui.maximized.is_some_and(|m| m != panel && app.ui.dock.is_docked(m))) + || !app.dock_rects.iter().any(|(p, _)| *p == panel) || !matches!(key, egui::Key::ArrowLeft | egui::Key::ArrowRight) { return false;