pub enum RowFit {
Clip,
Wrap {
run_spacing: f64,
},
WrapColumns {
run_spacing: f64,
},
Scroll,
}Expand description
How a row treats content wider than the window it is in
(docs/size-classes.md “Row fit policies”).
A row’s children negotiate one line; the fit policy is what happens when that line is
wider than the space the row is given. Every policy keeps the same children and the same
call shape, row((…)).fit(…), so a page can move between them as its needs change. A row
that should become a column on a narrow window is adaptive, a piece of
its own.
Variants§
Clip
One line at natural sizes; what does not fit lands offscreen. The default, and the right contract for a label beside a value. Debug builds log the overflow once per container, naming the dayscript ids in reach.
Wrap
Break onto additional lines where the next child would overflow, like wrapped text:
the shape a chip row or button strip wants. run_spacing is the vertical gap between
lines. Wrapping replaces main-axis negotiation, so .grow() and spacer() are inert.
WrapColumns
Wrap into aligned columns rather than ragged lines: every cell takes the widest
child’s width, and each line holds as many as the window fits. The tidier arm of
Wrap: same wrapping, but the lines stack into a grid, which is what
a set of peer choices (a keypad, a palette, evenly-weighted chips) wants. The column
count follows the available width. When any child grows (.grow_w()), the widest child
becomes the narrowest a column gets and the columns stretch to share the whole width,
the adaptive grid a gallery of tiles wants. No cell is wider than the line: on a window
narrower than the widest child, the cells take its width and their text wraps. An
authored, fixed column count with
per-cell spans is grid’s job instead (docs/grid.md).
Scroll
Keep the single line and make it a horizontal scroll strip instead of clipping. The strip stays one row tall and fills the width it is given.
Trait Implementations§
impl Copy for RowFit
impl StructuralPartialEq for RowFit
Auto Trait Implementations§
impl Freeze for RowFit
impl RefUnwindSafe for RowFit
impl Send for RowFit
impl Sync for RowFit
impl Unpin for RowFit
impl UnsafeUnpin for RowFit
impl UnwindSafe for RowFit
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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