diff --git a/crates/ui-egui/src/file_picker.rs b/crates/ui-egui/src/file_picker.rs index afd683ddd..56d0dcf59 100644 --- a/crates/ui-egui/src/file_picker.rs +++ b/crates/ui-egui/src/file_picker.rs @@ -310,7 +310,13 @@ mod tests { Box::pin(std::future::ready(None)) })); h.app.run("sketch.create", json!({"plane": "XY"})).unwrap(); - for (command, want) in [("sketch.insert_svg", vec!["svg"]), ("sketch.insert_dxf", vec!["dxf"]), ("file.insert_step", vec![])] { + for (command, want) in [ + ("sketch.insert_svg", vec!["svg"]), + ("sketch.insert_dxf", vec!["dxf"]), + ("file.insert_step", vec![]), + ("canvas.insert", vec!["png", "jpg", "jpeg"]), + ("canvas.decal", vec!["png", "jpg", "jpeg"]), + ] { h.app.start(command); tick(&mut h.app, &h.ctx); assert_eq!(asked.borrow().last().cloned(), Some(want.iter().map(|e| e.to_string()).collect::>()), "{command}"); diff --git a/crates/ui-egui/src/sketch_tools.rs b/crates/ui-egui/src/sketch_tools.rs index 1e9b987df..bedd33883 100644 --- a/crates/ui-egui/src/sketch_tools.rs +++ b/crates/ui-egui/src/sketch_tools.rs @@ -276,7 +276,8 @@ pub fn start_hook(app: &mut SolveApp, id: &str) -> bool { return true; } let command = id.to_string(); - app.pick_open(move |app, path| { + // Offer the image types first: the default Open filter lists only designs and meshes. + app.pick_open_for(&["png", "jpg", "jpeg"], move |app, path| { if let Some(path) = path { IMAGE.with(|i| *i.borrow_mut() = Some(path)); app.last_command = solidcraft_engine::find_command(&command).map(|spec| (spec.id.into(), spec.label.into()));