mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-12 21:32:52 +00:00
#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.
This commit is contained in:
2 files changed
+8
-4
No files matched your search
@@ -409,8 +409,8 @@ pub struct EffectcraftApp {
|
||||
applied_prefs: Option<(u64, Option<bool>)>,
|
||||
/// A previous run that didn't exit cleanly (shown by `Dialog::Recovery`).
|
||||
pub recovery: Option<effectcraft_engine::autosave::Recovery>,
|
||||
/// 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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user