Expand description
The system’s places the in-app picker lists beside home: its folders (Desktop, Documents, Downloads, Pictures, Music, Videos) and the volumes mounted, removable cards among them, the first place of a photo import.
system_places reads them from the system: on Linux and the BSDs the
XDG user directories (user-dirs.dirs) and the mount points under
/run/media/<user>, /media and /mnt; on macOS the folders in home
and /Volumes; on Windows the folders in the user’s profile and the
drives. They are read when a picker opens, not each frame. An
application gives its own with Files::set_system_places (a demo, a
sandbox, tests).
Beside them, an application adds sections of its own (a photo
import’s cards, services and history): a PlaceProvider registered on
the files service (Files::place_providers, FilesPlugin::places)
gives PlaceSections of PlaceItems. The in-app picker lists them
under its own places, and a PlacesPanel draws all of them anywhere
(an import window’s sources column). An item is a name, an icon, a
detail, a badge and, for a folder, its path; egui-pop knows nothing more
of it: an item without a path (an account of a service) is the
application’s to act on.
A panel goes further than the picker’s list, each part opt-in: a section
that folds (PlaceSection::foldable), says what it lacks
(PlaceSection::empty) or has no heading (PlaceSection::untitled); an item with a line shown under its name
(PlaceItem::line), a badge in a tone (PlaceItem::badge_tone) and
a toggle of the application’s (a pin, PlaceToggle); and room under
an item or a section for the application’s own content
(PlacesPanel::under_item, PlacesPanel::under_section). What the
user did comes back in PlacesOutput: the application keeps the
state and acts.
Structs§
- Place
Badge Icon - A state badge on a
PlaceItem’s icon (PlaceItem::badge_icon). - Place
Image - The image of a
PlaceItem(PlaceItem::image): an egui image source, two of them equal when egui would load them as one (the same URI, or the same texture at the same size). - Place
Item - One place of a
PlaceSection: a folder, a volume, or an application’s own (a card, an account of a service). Made withPlaceItem::neworPlaceItem::folderand its builders. - Place
Providers - The place providers declared, as a service of
Files. - Place
Section - A titled list of places: the system’s folders, the devices, or an
application’s (“Cards”, “Services”); or an untitled one, its rows shown
without a heading (
PlaceSection::untitled). - Place
Segment - A segment of a
PlaceItem’s compacted name (PlaceItem::segments): what it shows, the application’s id for it, and what a screen reader says of it. - Place
Segment Click - A click on one segment of an item’s compacted name
(
PlacesOutput::segment). - Place
Toggle - A toggle at the end of a
PlaceItem(a pin for the favourites): an icon on or off, named for assistive technology. The application owns its state: a click is reported (PlacesOutput::toggled), and the application gives the item again with the new state. - Places
Output - What a
PlacesPaneldid this frame. - Places
Panel - A side panel of places: sections, each a heading over its items, as the
in-app picker lists them (an import window’s sources column). One stop
for Tab; Up and Down go from item to item across the sections (through
an item’s toggle, a fold’s band and the application’s content, in the
order drawn), Enter or Space chooses. Each item is a button named by its
name and badge, described by its line, selected or not; each title a
heading, or a fold’s band when the section folds. What a chosen item
does is the caller’s:
PlacesOutput::chosen. - System
Places - The system’s places, as the picker lists them.
- Volume
- A volume mounted: its name and where it is.
Enums§
- Indent
Guides - When a hand-built tree draws its indent guides: a thin line down each
nesting level, as VS Code’s explorer does (
renderIndentGuides). Never by default, so that a tree looks as it always did. - System
Folder - A folder of the system’s, by what it is for.
Constants§
- SEGMENT_
SEPARATOR - The separator egui-pop draws between a
PlaceItem’s segments.
Traits§
- Place
Provider - An application’s sections of places (
PlaceProviders::register). Asked each time a picker or a panel is drawn: it answers from what it holds (a device watch’s list, a history kept in memory), never reading a disk or a network there.
Functions§
- system_
places - The system’s places, read from the system (see the module).
- xdg_
user_ dirs - The folders
user-dirs.dirsnames (XDG_PICTURES_DIR="$HOME/Pictures"), in the picker’s order; one set to home itself means none, as the specification says. Whether they exist is not checked.