pub struct LanesLayout {
pub min_width: f64,
pub max: usize,
pub spacing: f64,
pub run_spacing: f64,
pub balanced: bool,
}Expand description
Column lanes (docs/size-classes.md “Lanes”): as many equal-width columns as the available
width holds at min_width each, up to max, with the children dealt into them and each
lane stacking its own. The count is decided in layout, so a width change moves the same
children between lanes: nothing is rebuilt and no state is lost.
Fields§
§min_width: f64The narrowest a lane gets; the lane count is how many of these fit.
max: usizeThe most lanes, however wide the container; at least one.
spacing: f64Gap between lanes.
run_spacing: f64Gap between the children of one lane.
balanced: boolPut each child in the lane that is shortest so far, instead of dealing in turn.
Implementations§
Source§impl LanesLayout
impl LanesLayout
Sourcepub fn lane_count(&self, width: Option<f64>) -> usize
pub fn lane_count(&self, width: Option<f64>) -> usize
How many lanes width holds: one more for every min_width plus gap that fits, never
fewer than one, never more than max. An unbounded width takes max.
Trait Implementations§
Source§impl Layout for LanesLayout
impl Layout for LanesLayout
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>
Where this node’s own first text baseline falls, measured from the top of a box of
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 Forget for LanesLayout
impl Freeze for LanesLayout
impl Move for LanesLayout
impl RefUnwindSafe for LanesLayout
impl Send for LanesLayout
impl Sync for LanesLayout
impl Unpin for LanesLayout
impl UnsafeUnpin for LanesLayout
impl UnwindSafe for LanesLayout
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
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> ⓘ
Converts
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> ⓘ
Converts
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