diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index ab17c1374..53ae252a5 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -44,6 +44,8 @@ mod tests_album_picker; #[cfg(test)] mod tests_crop_rotate; #[cfg(test)] +mod tests_crop_tool; +#[cfg(test)] mod tests_curve; #[cfg(test)] mod tests_date_picker; @@ -232,6 +234,9 @@ pub struct LightcraftApp { /// The keyboard shortcuts editor is waiting for a key press for this command: no shortcut /// fires (the native menu bar drops its accelerators too) until it gets one or is cancelled. pub recording_shortcut: Option, + /// A text field had the keyboard at the end of the last frame. egui drops the focus as Esc + /// arrives, before the shortcuts are read, so this is how Esc there stays the field's own. + pub text_focus: bool, /// The host is [`headless::Headless`] (it answers viewport screenshot commands itself). pub headless_host: bool, /// Warnings to show one at a time (damaged settings files…, issue #103). @@ -344,6 +349,7 @@ impl LightcraftApp { native_menu: false, native_shortcuts: Default::default(), recording_shortcut: None, + text_focus: false, headless_host: false, notices: vec![], quit_prompt: None, @@ -1076,6 +1082,7 @@ impl LightcraftApp { panels::keyword_list::drag_feedback(self, &ctx); panels::toast(self, &ctx); self.widgets = widgets::take_registry(&ctx); + self.text_focus = ctx.egui_wants_keyboard_input(); self.end_frame(&ctx, t0); } } diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 81a46eb98..7483c0891 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -406,6 +406,9 @@ pub fn run_ui_command(app: &mut LightcraftApp, id: &str, p: &Value) -> Option