Skip to main content

gallery/
eclipse.rs

1//! Eclipse tab: Stencil's stippled-eclipse landing shader.
2//!
3//! Mounts [`omp_tui::shader::Eclipse`] — the reference
4//! [`omp_tui::shader::Program`] — as a pane-filling component. The shader
5//! viewport is sized at build time; the pane clips it on shrink.
6
7use omp_tui::{Component, IntoComponent as _, Size, components::Shader, dom, shader::Eclipse};
8
9/// The eclipse-shader pane hosted by the gallery's `Eclipse` tab, sized to
10/// `viewport` minus the tab chrome.
11pub(crate) fn pane(viewport: Size, rows: u16) -> Box<dyn Component> {
12	dom! {
13		<col>
14			{Shader::new(Eclipse::default()).size(viewport.width, rows)}
15			<text dim>{"stencil.so eclipse"}</text>
16		</col>
17	}
18	.into_component()
19}