Trait Layout
pub trait Layout {
// Required methods
fn name(&self) -> &'static str;
fn container(&self, resolved: &Resolved, lead: f32) -> Style;
fn slot(&self, index: usize, slot: &Slot, resolved: &Resolved) -> Style;
// Provided methods
fn leading(&self) -> Side { ... }
fn settle(&mut self, _allocated: Size<f32>, _resolved: &Resolved) -> bool { ... }
fn items(&mut self, _count: usize) { ... }
fn hidden(&self, _index: usize) -> bool { ... }
}Expand description
How a primitive arranges its slots. See the module docs.
Required Methods§
fn name(&self) -> &'static str
Provided Methods§
fn leading(&self) -> Side
fn leading(&self) -> Side
The side the arrangement leads on: where lead reserves its gutter. A row written
right to left leads on the right.
fn settle(&mut self, _allocated: Size<f32>, _resolved: &Resolved) -> bool
fn settle(&mut self, _allocated: Size<f32>, _resolved: &Resolved) -> bool
Decide the arrangement from the allocated size. Returns whether the styles must be computed again.
fn items(&mut self, _count: usize)
fn items(&mut self, _count: usize)
How many slots the container holds, told before each layout: a layout that arranges by count (a grid that keeps no empty columns) reads it.
Whether slot index is not shown in the current arrangement.