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
@@ -43,7 +43,7 @@ const JS_EXTS: &[&str] = &["js"];
/// The open dialog for a JavaScript file.
fn pick() -> FilePick {
FilePick { filters: vec![("JavaScript", JS_EXTS)], ..Default::default() }
FilePick { filters: vec![FilePick::filter("JavaScript", JS_EXTS)], ..Default::default() }
}
/// Choose…: the file picked in the open dialog into File or URL, as a `file:///` URL