From 5c54cce8dcaa88714400485db242d1bdca4942fa Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 17:19:35 +0000 Subject: [PATCH] clippy: egui's ComboBox is the combo box on craft-libs next; Escape helpers take the context by value --- clippy.toml | 3 --- crates/ui-egui/src/dialogs/ref_edit.rs | 2 +- crates/ui-egui/src/dialogs/show.rs | 2 +- crates/ui-egui/src/macro_editor.rs | 2 +- crates/ui-egui/src/text_box.rs | 2 +- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/clippy.toml b/clippy.toml index c6fbddafd..f04cb8a95 100644 --- a/clippy.toml +++ b/clippy.toml @@ -11,7 +11,4 @@ disallowed-methods = [ { path = "std::time::SystemTime::now", reason = "traps on wasm; read the clock only off wasm" }, ] -disallowed-types = [ - { path = "egui::ComboBox", reason = "use craft_ui::ComboBox: egui's combo box menu can't grow back while open (egui#5225)" }, -] cognitive-complexity-threshold = 30 diff --git a/crates/ui-egui/src/dialogs/ref_edit.rs b/crates/ui-egui/src/dialogs/ref_edit.rs index 551012cf1..b14ab66be 100644 --- a/crates/ui-egui/src/dialogs/ref_edit.rs +++ b/crates/ui-egui/src/dialogs/ref_edit.rs @@ -186,7 +186,7 @@ pub(super) fn place_window<'a>( // Escape and Enter are used up either way: left in the frame's input, the dialog would // read them as its own and close or confirm. When another field owned them, that field // (drawn before the dialogs) has read them already, and nothing more happens here. - if crate::framework::consume_escape(&ctx) | ctx.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::Enter)) { + if crate::framework::consume_escape(ctx) | ctx.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::Enter)) { if !other_field { d.refs.collapsed = None; } diff --git a/crates/ui-egui/src/dialogs/show.rs b/crates/ui-egui/src/dialogs/show.rs index e1f6981ce..a75df44e9 100644 --- a/crates/ui-egui/src/dialogs/show.rs +++ b/crates/ui-egui/src/dialogs/show.rs @@ -400,7 +400,7 @@ pub fn show(app: &mut SheetApp, ctx: &egui::Context) { open_url(&u); } } - if crate::framework::escape_pressed(&ctx) || !win_open { + if crate::framework::escape_pressed(ctx) || !win_open { // In Solver Options, Escape (or closing the window) cancels the options only. if in_solver_options(&d) { cancel_solver_options(&mut d); diff --git a/crates/ui-egui/src/macro_editor.rs b/crates/ui-egui/src/macro_editor.rs index 5f220efdc..cb7acafff 100644 --- a/crates/ui-egui/src/macro_editor.rs +++ b/crates/ui-egui/src/macro_editor.rs @@ -959,7 +959,7 @@ pub fn window(app: &mut SheetApp, ctx: &egui::Context, d: &mut Dialog, open: &mu *open = false; } } - if crate::framework::escape_pressed(&ctx) && ed.picker.is_some() { + if crate::framework::escape_pressed(ctx) && ed.picker.is_some() { ed.picker = None; } prompts(app, ctx, &mut ed, open); diff --git a/crates/ui-egui/src/text_box.rs b/crates/ui-egui/src/text_box.rs index 2eae0148c..54ac87296 100644 --- a/crates/ui-egui/src/text_box.rs +++ b/crates/ui-egui/src/text_box.rs @@ -93,7 +93,7 @@ impl SheetApp { /// Resolve outside clicks before the ribbon/tabs can save or switch the workbook. pub(crate) fn before_ui(app: &mut SheetApp, ctx: &egui::Context) { let Some(ed) = &app.text_box_editor else { return }; - if crate::framework::consume_escape(&ctx) { + if crate::framework::consume_escape(ctx) { app.cancel_text_box_edit(); ctx.memory_mut(|m| m.surrender_focus(editor_id())); return;