pub struct FlowLayout {
pub spacing: f64,
pub run_spacing: f64,
pub align: CrossAlign,
pub uniform: bool,
}Expand description
A wrapping row (docs/size-classes.md “Adaptive pieces”): children keep their natural
measure and lay out leading-to-trailing, breaking onto a new line where the next child
would overflow the proposed width. Wrapping replaces main-axis negotiation, so flex is
inert here: nothing grows, and a spacer() contributes nothing. RTL mirroring comes from
place_child, the same as every layout.
Fields§
§spacing: f64§run_spacing: f64Vertical gap between lines.
align: CrossAlignHow children align within their own line (a line is as tall as its tallest child).
uniform: boolUniform columns (RowFit::WrapColumns): every cell takes the widest child’s width and
each line holds as many as the available width fits, so the wrapped lines align into
columns; when any child grows (grow_w), the columns stretch to share the whole width.
false packs each line at natural widths, which comes out ragged.
Trait Implementations§
Source§impl Layout for FlowLayout
impl Layout for FlowLayout
fn measure( &self, cx: &mut dyn LayoutOps, children: &[RNode], p: Proposal, ) -> Size
fn place(&self, cx: &mut dyn LayoutOps, children: &[RNode], bounds: Rect)
Source§fn baseline(
&self,
_cx: &mut dyn LayoutOps,
_children: &[RNode],
_size: Size,
) -> Option<f64>
fn baseline( &self, _cx: &mut dyn LayoutOps, _children: &[RNode], _size: Size, ) -> Option<f64>
size (docs/baseline.md). None (the default) means the node has no baseline to
offer, so a baseline-aligned parent falls back to box alignment for it. Read moreAuto Trait Implementations§
impl Freeze for FlowLayout
impl RefUnwindSafe for FlowLayout
impl Send for FlowLayout
impl Sync for FlowLayout
impl Unpin for FlowLayout
impl UnsafeUnpin for FlowLayout
impl UnwindSafe for FlowLayout
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more