Expand description
A file browser with pluggable view modes (design).
FileBrowser owns what every view shares: the entries of a place, read
from a FileSource; the selection and the focus; type-ahead; the mode
switcher. A ViewMode draws the entries and answers what the person
did; the browser decides what it means. Thumbnails come from a
ThumbnailProvider, egui-pop’s default being PreviewThumbnails over
the files service’s preview providers.
Built-in modes: DetailsMode (rows with columns), ThumbnailsMode
(a virtualised grid), FilmstripMode, ColumnsMode (Finder’s),
CarouselMode and AgendaMode (by day). Others register on a
ViewModes registry.
Structs§
- Agenda
Mode - The entries by day, month or year, the newest first: one heading per
group (when the entry was taken, given by the application’s source, else
when it last changed; UTC), which a click collapses or expands, its
entries under it in a grid, the newest first, those without a time last.
The arrows move across the groups’ grids;
Ctrl+UpandCtrl+Downchange the level,Ctrl+LeftandCtrl+Rightcollapse and expand the focused entry’s group. The dates and the groups are computed once per listing, not every frame. - Agenda
Settings - The agenda’s settings: its level, and the groups collapsed at that level
(
None: the entries without a time). A change of level expands them all. - AppDrop
Target - One of the application’s own drop targets: an id it is reported by, and the label its zone shows.
- Browser
Output - What the browser did this frame.
- Carousel
Mode - The focused entry large in the middle, at the thumbnail size (smaller
when the room is short), its neighbours smaller and smaller on each
side (Finder’s Gallery), spaced by their cells’ own widths. Left and Right bring the
previous or next entry to the middle; a click on a neighbour does too.
The middle one asks for its thumbnail first, then the neighbours
outwards, then the next one on each side (
Near). - Column
- One folder’s listing beside the place’s: an ancestor, or the focused folder looked into, for a mode that shows the path as columns.
- Column
Listings - The listings of the columns beside the place’s, for a mode that shows
the path (Finder’s columns): the place’s ancestors and the focused folder
looked into. Each lists off the interface thread when its source does
(a
FsSourceover the system’s file system), its entries streaming in page by page,Column::loadinguntil the end; one no longer wanted (the focus moved on, the place changed) is dropped, which cancels it. - Columns
Mode - Finder’s columns: one column per folder of the path, the place’s last, then the focused entry looked into (a folder’s entries, a file’s thumbnail and facts). Up and Down move in the place’s column; Right enters the focused folder, Left goes back to the parent.
- Details
Mode - Rows with columns: the name, the size and when it last changed.
- Dragged
Paths - Paths dragged inside the application, for a file browser to take: the
payload a widget sets with
egui::DragAndDrop::set_payloadas a drag starts. - Drop
Offer - A drop on offer: what the application’s
acceptis asked about while hovering, and whatBrowserOutput::droppedgives once it is taken. While a system drag hovers,pathsmay be empty: some platforms say the files only on the drop. - Entry
Filter - Which entries a browser shows (
FileBrowser::set_filter): files by extension, and one kind of entry or both. Folders pass an extension filter (the person goes through them), unless the kind leaves them out. A group is shown when its main file passes, its members with it. - Entry
Marks - What an application says of an entry beyond its facts
(
FileBrowser::with_marks): short badges drawn as text on its cell and after its name; chips (an icon or a short text in a corner of its thumbnail,MarkChip); both said with its name to assistive technology; and whether it is dimmed (shown, but not what the person acts on). - File
Browser - The file browser: entries from a
FileSource, shown by aViewModechosen in its toolbar (or withCtrl+1toCtrl+9), kept per dialog in the host’s store when drawn withFileBrowser::show_in. - Filmstrip
Mode - One row of thumbnails, the focused entry large above it (Lightroom’s
Loupe and Filmstrip). The large view asks first (
Visible), then the strip’s cells in view, then the next screen of them (Near). - FsSource
- A
FileSourceover asuper::fs::FileSystem: in pages ofpage_size, on a thread of its own for the system’s file system (off the web), at once for one held in memory. - List
Options - How to list.
- Listing
- A listing under way: its pages arrive through
Listing::poll, and the frame never waits. Dropping it cancels it. - Listing
Sender - The source’s end of a
Listing. - Mark
Chip - A mark in a corner of an entry’s thumbnail: an icon (“in your Library” as a check) or a short text (“R+J” for a RAW and JPEG pair), on a pill of its tone. Its name is said after the entry’s name and is its tooltip.
- Mode
Context - What a mode is given to draw.
- Mode
Info - What a mode is, for the switcher, persistence, agents and screen readers.
- Mode
Needs - What a mode needs from the browser.
- Mode
Output - What the person did in a mode; the browser decides what it means.
- Mode
Settings - A mode’s own settings, kept per browser.
- NoThumbnails
- A provider that gives nothing: icons stand in.
- Plain
Drawer - The browser’s own drawing: a plain row (name, size, date) or a cell (the thumbnail and the name), selected and focused as the context says.
- Preview
Thumbnails - egui-pop’s default thumbnails: the files service’s preview providers
(PNG and JPEG with
image, folders, the system’s thumbnails when installed), made by their worker, visible first. - Reach
- Somewhere a mode asks the browser to go: a place, and the entry to focus there (a click in another column than the place’s).
- Recorded
Thumbnails - What a recording
ThumbnailProvidersaw, for tests and agents. - Recording
Thumbnails - A provider that makes nothing and records what it is asked, to check a mode’s loading order.
- Renewals
- The bookkeeping of renewed requests: what a frame asked, in priority order, and what the frame before asked that this one did not.
- Selection
- The selected entries, by path, and the anchor a range starts from.
- Selection
Policy - What a browser lets the person select (
FileBrowser::set_selection_policy): which kind of entry, and one or several. A click, the keys, a rubber band, select all andFileBrowser::set_selectionall keep to it; an entry it refuses is still focused and opened. - Source
Entry - One entry as a source gives it.
- Thumb
Request - One thumbnail asked for.
- Thumbnails
Mode - A virtualised grid of thumbnails with their names. Only the cells in view
ask for a thumbnail, in reading order, then the next row as
Near, so what scrolls away is cancelled by the provider. - View
Modes - The view modes on offer, in the switcher’s order: the built-ins first, then those plugins register (and take back when they disconnect).
Enums§
- Agenda
Level - What an agenda groups its entries by.
- Drop
Origin - Where what is dropped comes from.
- Drop
Target - Where a drop goes.
- Entry
Kind - What an entry is.
- Grid
Resize - How a thumbnail grid’s zoom answers a resize: what the zoom (its
slider,
Ctrland+or-,Ctrland the wheel) means, and so what a wider grid shows. - Mark
Corner - The corner of a thumbnail a
MarkChipsits in. Chips in one corner line up from it towards the middle, in their order. - ModeKey
- A key a mode moves the focus with: its layout decides where it goes.
- Page
- What a listing delivers, in order.
- Priority
- How soon a thumbnail is wanted.
- Select
Mode - How many entries can be selected.
- Selectable
- Which kind of entry can be selected (
SelectionPolicy). - Source
Error - Why a source could not list.
- Thumb
State - A thumbnail’s state.
- Thumb
Zoom - A thumbnail grid’s zoom: how many thumbnails fill a row, the API’s
side of the library grid’s
Zoom(egui_pop_views::library::grid, which converts from and into it). - Travel
- A key that leaves the place, in a mode that shows the path.
Constants§
- MODE_
AGENDA - The id of the agenda mode.
- MODE_
CAROUSEL - The id of the carousel mode.
- MODE_
COLUMNS - The id of the columns mode (Finder’s).
- MODE_
DETAILS - The id of the details mode, the first in the switcher.
- MODE_
FILMSTRIP - The id of the filmstrip mode.
- MODE_
KEYS - How many modes have a key (
Ctrl+1toCtrl+9). - MODE_
THUMBNAILS - The id of the thumbnails mode.
- SEGMENTED_
MAX - Up to this many modes, the switcher is a segmented control; beyond, a menu.
Traits§
- Entry
Drawer - Draws the entries a mode lays out, one at a time: the layer that knows
its host. A mode owns the layout (the virtualised rows or cells, the
scrolling, the keys’ moves, the thumbnails’ order); the drawer owns what
an entry looks like and does. The browser’s own is
PlainDrawer; the in-app picker gives its rows with their columns, its groups’ badges, the highlight its field drives and its own clicks. - File
Source - Where a browser’s entries come from: a file system, a camera card, a catalogue. Entries are paged and streamed.
- Thumbnail
Provider - Makes thumbnails off the interface thread. A frame starts with
ThumbnailProvider::begin_frame, asks withThumbnailProvider::request, and ends withThumbnailProvider::end_frame: a request not renewed in a frame is cancelled, so what scrolled away leaves the queue without the mode’s help. - View
Mode - A way to show a browser’s entries. It draws and reports; selection rules, what Enter does and what a click on a folder does are the browser’s.
Functions§
- mode_
key - The
n-th mode key pressed (Ctrl+1is 1), consumed;Nonewhen none was. - mode_
label - A mode’s name in the interface’s language: the catalogue’s
egui-pop-files-mode-<id>, else its English label. - mode_
switcher - The mode switcher: a segmented control for up to
SEGMENTED_MAXmodes, a menu beyond. Each mode’s label is translated (mode_label), its icon drawn from the icon registry when it resolves, its keys in its tip. Answers the mode pressed, if one was (the one shown too: a press may move the keyboard elsewhere). - paint_
cell - A cell’s thumbnail (or what stands in for it) and its name, in
rect. - paint_
marks - A cell’s marks over its thumbnail: dimmed, its badges stacked from the image’s bottom left corner, its chips in their corners. Gives where each chip was drawn, in their order.
- request_
mode - Asks the file browser holding the keyboard for its
n-th mode (from 1, in the switcher’s order): what thefile.view.mode<n>commands do. Taken by the browser’s next frame. - take_
focused - Whether a file browser held the keyboard in the frame drawn last; read
once (the flag is cleared), for the mode keys’
whenclause.
Type Aliases§
- Mark
Entries - What gives an entry’s marks (
FileBrowser::with_marks). - Thumbnail
Cache - Thumbnails per path, for a mode’s own use.