pub struct Wrap { /* private fields */ }Expand description
A widget that lays out children left-to-right and wraps to a new row when the available width is exhausted.
spacingcontrols horizontal space between items.run_spacingcontrols vertical space between rows.
Implementations§
Source§impl Wrap
impl Wrap
Sourcepub fn spacing(self, s: f32) -> Self
pub fn spacing(self, s: f32) -> Self
Set the horizontal gap in logical pixels between items in the same row.
Sourcepub fn run_spacing(self, s: f32) -> Self
pub fn run_spacing(self, s: f32) -> Self
Set the vertical gap in logical pixels between rows.
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.
Items are placed left-to-right; when the next item would exceed the constraint’s maximum width the layout wraps to a new row.
Emits RosaceTrace::LayoutStart and RosaceTrace::LayoutEnd events.
Trait Implementations§
Source§impl ChildContainer for Wrap
impl ChildContainer for Wrap
Auto Trait Implementations§
impl !RefUnwindSafe for Wrap
impl !UnwindSafe for Wrap
impl Freeze for Wrap
impl Send for Wrap
impl Sync for Wrap
impl Unpin for Wrap
impl UnsafeUnpin for Wrap
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