pub struct Grid { /* private fields */ }Expand description
A widget that arranges its children in a grid with a fixed number of columns.
Row heights are determined by the tallest child in each row; column widths
by the widest child in each column. Use spacing to add
a uniform gap between cells on both axes.
Implementations§
Source§impl Grid
impl Grid
Sourcepub fn new(columns: usize) -> Self
pub fn new(columns: usize) -> Self
Create a new Grid with the given number of columns and zero spacing.
Sourcepub fn spacing(self, s: f32) -> Self
pub fn spacing(self, s: f32) -> Self
Set the gap in logical pixels between cells (applied horizontally and vertically).
Sourcepub fn layout(
&self,
constraints: Constraints,
child_sizes: &[Size],
) -> LayoutResult
pub fn layout( &self, constraints: Constraints, child_sizes: &[Size], ) -> LayoutResult
Perform the Measure + Place passes and return a LayoutResult.
child_sizes must be in the same order as children appended via
ChildContainer::child / ChildContainer::children.
Emits RosaceTrace::LayoutStart and RosaceTrace::LayoutEnd events.
Trait Implementations§
Source§impl ChildContainer for Grid
impl ChildContainer for Grid
Auto Trait Implementations§
impl !RefUnwindSafe for Grid
impl !UnwindSafe for Grid
impl Freeze for Grid
impl Send for Grid
impl Sync for Grid
impl Unpin for Grid
impl UnsafeUnpin for Grid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more