mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-03 06:30:00 -06:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user