Skip to main content

Module mode

Module mode 

Source
Expand description

The library grid as a file browser’s view mode: a folder shown the way the Library shows photos.

LibraryGridMode lays the browser’s entries out as its thumbnails mode does (the zoom as a count per row, the rubber band, the arrows, Page Up and Page Down, Home and End), and draws over each cell the library’s marks: the flag top left, the colour labels top right, the rating’s stars bottom left, a rejected image dimmed. The marks are the application’s (LibraryGridMode::new); a screen reader hears them as the cell’s description.

The culling keys (CullKeymap, Lightroom’s by default) rate, flag and label the selection, else the focused entry. They do not change the marks: they give Signals (Rate, Flag, Label, keyed by path) into a LibrarySignals handle the application drains and applies. With auto-advance, the focus then moves to the next entry.

A browser’s grouping (FileBrowser::with_grouping) stands for the library’s stacks: a group is one entry, its members said by its chip.

use egui_pop_api::files::browser::ViewModes;
use egui_pop_views::library::marks::Marks;
use egui_pop_views::library::mode::{LibraryGridMode, LibrarySignals};

let signals = LibrarySignals::default();
let modes = ViewModes::default();
LibraryGridMode::new(|_entry| Marks::default())
    .signals(signals.clone())
    .register(&modes)
    .unwrap();
assert!(modes.ids().contains(&"library".to_string()));
// Each frame, after the browser is drawn:
for _signal in signals.drain() { /* apply it to the files' marks */ }

Structs§

LibraryGridMode
The library grid, a file browser’s view mode (module docs). Register it on a browser’s ViewModes with LibraryGridMode::register.
LibrarySignals
Where a library grid’s culling keys say what the person asked for: a shared queue the application drains, each frame, after drawing the browser. Clones share the queue.

Constants§

MODE_LIBRARY
The library grid’s id among a browser’s modes.

Functions§

spoken
The marks in words, as a screen reader says them after the entry’s name: “Rated 3 of 5, Pick, Red”; None without any.

Type Aliases§

EntryLibraryMarks
What gives an entry’s library marks.