pub struct GridCtx<'a> { /* private fields */ }Expand description
Closure context passed into grid() closures for accumulating grid children.
Supports plain panels, panels with column spans, and nested row/col/grid containers. Errors are deferred: the first failure is stored and all subsequent operations become no-ops. The stored error surfaces when the parent builder method returns.
Implementations§
Source§impl GridCtx<'_>
impl GridCtx<'_>
Sourcepub fn panel(&mut self, kind: impl Into<Arc<str>>) -> PanelId
pub fn panel(&mut self, kind: impl Into<Arc<str>>) -> PanelId
Add a grid item panel with grow(1.0) default constraints. Returns its PanelId.
Sourcepub fn panel_with(
&mut self,
kind: impl Into<Arc<str>>,
constraints: Constraints,
) -> PanelId
pub fn panel_with( &mut self, kind: impl Into<Arc<str>>, constraints: Constraints, ) -> PanelId
Add a grid item panel with explicit constraints. Returns its PanelId.
Sourcepub fn panel_span(
&mut self,
kind: impl Into<Arc<str>>,
span: CardSpan,
) -> PanelId
pub fn panel_span( &mut self, kind: impl Into<Arc<str>>, span: CardSpan, ) -> PanelId
Add a grid item panel with a column span and grow(1.0) default constraints.
Returns its PanelId.
Sourcepub fn panel_with_span(
&mut self,
kind: impl Into<Arc<str>>,
constraints: Constraints,
span: CardSpan,
) -> PanelId
pub fn panel_with_span( &mut self, kind: impl Into<Arc<str>>, constraints: Constraints, span: CardSpan, ) -> PanelId
Add a grid item panel with explicit constraints and a column span.
Returns its PanelId.
Sourcepub fn row(&mut self, f: impl FnOnce(&mut ContainerCtx<'_>))
pub fn row(&mut self, f: impl FnOnce(&mut ContainerCtx<'_>))
Nest a row container with zero gap. Children are built in the closure.
Sourcepub fn row_gap(&mut self, gap: f32, f: impl FnOnce(&mut ContainerCtx<'_>))
pub fn row_gap(&mut self, gap: f32, f: impl FnOnce(&mut ContainerCtx<'_>))
Nest a row container with the specified gap between children.
Sourcepub fn col(&mut self, f: impl FnOnce(&mut ContainerCtx<'_>))
pub fn col(&mut self, f: impl FnOnce(&mut ContainerCtx<'_>))
Nest a column container with zero gap. Children are built in the closure.
Sourcepub fn col_gap(&mut self, gap: f32, f: impl FnOnce(&mut ContainerCtx<'_>))
pub fn col_gap(&mut self, gap: f32, f: impl FnOnce(&mut ContainerCtx<'_>))
Nest a column container with the specified gap between children.
Sourcepub fn row_gap_with(
&mut self,
gap: f32,
constraints: Constraints,
f: impl FnOnce(&mut ContainerCtx<'_>),
)
pub fn row_gap_with( &mut self, gap: f32, constraints: Constraints, f: impl FnOnce(&mut ContainerCtx<'_>), )
Nest a row container with explicit constraints and the specified gap.
Sourcepub fn col_gap_with(
&mut self,
gap: f32,
constraints: Constraints,
f: impl FnOnce(&mut ContainerCtx<'_>),
)
pub fn col_gap_with( &mut self, gap: f32, constraints: Constraints, f: impl FnOnce(&mut ContainerCtx<'_>), )
Nest a column container with explicit constraints and the specified gap.