pub struct FillAxes {
pub horizontal: bool,
pub vertical: bool,
}Expand description
The axes a widget asks to fill: on each, it takes the room its parent leaves it rather than shrink-wrapping its children.
§Why this is asked and not declared
width: 100% looks like the same thing and is not. A percentage resolves against the
parent’s resolved width, which a parent that shrink-wraps has not got yet — it is
waiting on this very child to find out how wide it should be. Both are “full width” in
English, and only one can be computed in time:
| what it needs | known | |
|---|---|---|
width: 100% | the parent’s own width | on the way back up |
| a fill request | the room being offered | on the way down |
Fifteen widgets in this crate said it the first way and every one of them collapsed under a plain column (milestone 404). Asking is the only phrasing the layout can answer.
Fields§
§horizontal: boolTake the width the parent offers.
vertical: boolTake the height the parent offers.
Implementations§
Source§impl FillAxes
impl FillAxes
Sourcepub fn single(self) -> Option<FlexDirection>
pub fn single(self) -> Option<FlexDirection>
The axes asked for, as one flex direction, or None where that cannot be said —
neither axis, or both. For the walk, which resolves each axis separately anyway.
Sourcepub fn along(direction: FlexDirection) -> Self
pub fn along(direction: FlexDirection) -> Self
The axis a frus_layout::FlexDirection names, and nothing else.