ImageViewer builder
A framed viewer for one image at a time.
A builder is RenderOnce. Construct and mount it in one expression.
use gpui_kit::content::ImageViewer;
Construct
new(ident: impl Into<Ident>, frames: impl IntoIterator<Item = ImageFrame>) -> SelfOptions
Chain onto the value.
showing(id: impl Into<SharedString>) -> Self
fit(fit: FitMode) -> Self
zoom_range(min: f32, max: f32) -> Self
height(height: f32) -> Self
image(supplier: impl Fn(&ImageFrame, &mut Window, &mut App) -> Option<AnyElement> + 'static) -> Self
on_event(handler: impl Fn(&ImageViewerEvent, &mut Window, &mut App) + 'static) -> SelfReports
The variants of the event it emits. It never applies the change itself.
- FitChanged
- Stepped
- ImageRequested
Rendered by
Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.