Skip to main content

Module thumbs

Module thumbs 

Source
Expand description

The file browser’s thumbnail contract in the library’s views: one ThumbnailProvider serves the browser, the picker, the grid, the filmstrip and the comparison.

ProviderThumbs is a ThumbSource over a provider, for one frame: made before the views are drawn (it begins the provider’s frame), dropped after (it ends it, so what scrolled away leaves the provider’s queue). The application says which file each key is.

use egui_pop_api::files::browser::{SourceEntry, ThumbnailProvider};
use egui_pop_views::library::thumbs::ProviderThumbs;

fn entry_of(key: &u64) -> Option<SourceEntry> { todo!() }

fn ui(ui: &mut egui::Ui, provider: &dyn ThumbnailProvider) {
    let thumbs = ProviderThumbs::begin(ui.ctx(), provider, entry_of);
    // ThumbGrid::show(ui, state, items, &thumbs) …
    drop(thumbs); // ends the provider's frame
}

Its badges meet the browser’s the same way: a Badge is a MarkChip (MarkChip::from(badge)), both drawn as indicators. So does its zoom: a grid’s Zoom and the browser’s and picker’s ThumbZoom are the same count per row, converted with From.

Structs§

ProviderThumbs
A ThumbSource over a ThumbnailProvider for one frame: made with ProviderThumbs::begin, which begins the provider’s frame, and dropped once the views are drawn, which ends it.