Skip to main content

Module file_picker

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§

FileFilter
A named file-type filter. An empty extensions list matches every file (the conventional “All files” entry).
FilePicker
FilePickerEntry

Enums§

FilePickerMode
Open picks existing files; Save adds a filename field whose contents resolve to current_dir/<name>; Directory picks existing folders.
FilePickerOutcome
Drained by the host via FilePicker::take_outcome once per frame; None means “user hasn’t decided yet”. The terminal variants resolve the host’s oneshot::Sender<Option<Vec<PathBuf>>>.

Constants§

FOOTER_HEIGHT
HEADER_HEIGHT
ROW_HEIGHT