FilePick filters own their text, so a dialog's file types can be made at run time: FileFilter is (String, Vec<String>), FilePick::filter makes one from literals and FilePick::filters converts the engine's lists; the macOS save panel, the Linux portal and the rfd dialogs take the owned lists. No behaviour changes.

This commit is contained in:
Jürg Lehni
2026-10-21 16:46:10 +07:00
committed by bflatastic
parent 5b77e422ab
commit 3f729b6481
27 changed files with 115 additions and 78 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result<Value, Stri
if app.services.open_async.is_some() {
return io::open_dialog(app).map(|_| Value::Null);
}
let pick = FilePick { filters: vec![("Scripts", vectorcraft_engine::cmd::scripts::EXTS)], ..Default::default() };
let pick = FilePick { filters: vec![FilePick::filter("Scripts", vectorcraft_engine::cmd::scripts::EXTS)], ..Default::default() };
params = json!({ "path": crate::picks::open(app, &pick).ok_or("cancelled")? });
}
if params.get("path").is_some()