Module file_picker
Expand description
File-picker dialog widget — used by the FileChooser xdg-portal backend
and any “open / save file from app menu” flow. Self-contained: it draws
and hit-tests itself, and the host just positions it as a modal overlay
and drains FilePicker::take_outcome.
Top to bottom: title + breadcrumb + up button, a scrollable list of
FilePickerEntrys (directory click navigates in file modes and selects
in directory mode; double-click navigates; Ctrl/Shift multi-select when
enabled), a filename
field in Save mode, an optional filter chip, and Cancel/Open(Save)
buttons. Keyboard: Up/Down move the selection, Enter opens/enters,
Backspace goes to the parent, Escape cancels; printable keys type-ahead
in Open mode or edit the filename in Save mode.
Constructed with “accessible roots” — the workspace-bound paths the
caller’s sandbox already allows. FilePicker::can_navigate_to gates
every path mutation against them so the user can’t .. out of the
sandbox boundary.
Modules§
- semantic
- Typed operations on the same scoped picker used by pointer and AT input.
Structs§
- File
Filter - A named file-type filter. An empty
extensionslist matches every file (the conventional “All files” entry). - File
Picker - File
Picker Entry
Enums§
- File
Picker Mode - Open picks existing files; Save adds a filename field whose contents
resolve to
current_dir/<name>; Directory picks existing folders. - File
Picker Outcome - Drained by the host via
FilePicker::take_outcomeonce per frame;Nonemeans “user hasn’t decided yet”. The terminal variants resolve the host’soneshot::Sender<Option<Vec<PathBuf>>>.