mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-26 04:23:01 +01:00
clippy: egui's ComboBox is the combo box on craft-libs next; Escape helpers take the context by value
This commit is contained in:
1 parent
2f585b0edd
commit
5c54cce8dc
5 files changed
+4
-7
No files matched your search
@@ -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
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user