pub struct LayoutProps {Show 22 fields
pub display: Display,
pub hidden: bool,
pub direction: Direction,
pub wrap: bool,
pub grow: f32,
pub shrink: f32,
pub basis: Length,
pub width: Length,
pub height: Length,
pub min_width: Length,
pub min_height: Length,
pub max_width: Length,
pub max_height: Length,
pub padding: Edges<Length>,
pub margin: Edges<Length>,
pub gap: Size,
pub align_items: Option<Align>,
pub justify_content: Option<Justify>,
pub position: Position,
pub inset: Edges<Length>,
pub border_width: Edges<f32>,
pub overflow: Overflow,
}Expand description
The properties that take part in layout.
Every field here reaches the layout engine, so a change to any of them
requires a new layout pass. A change to PaintProps alone does not.
Fields§
§display: DisplayWhich layout algorithm arranges this node’s children.
Whether the node and its subtree are left out of layout and paint
nothing. Hiding is kept apart from LayoutProps::display, so showing
the node again restores the layout algorithm it had.
direction: DirectionThe main axis of the flex layout.
wrap: boolWhether children that do not fit move to a new line instead of shrinking.
grow: f32Share of the leftover main axis space this node takes when it is a flex child. Zero keeps the node at its basis.
shrink: f32How readily this node gives up main axis space when flex children overflow. Zero never shrinks.
basis: LengthThe main axis size this node starts from before growing or shrinking.
width: LengthSize on the horizontal axis.
height: LengthSize on the vertical axis.
min_width: LengthLower bound for LayoutProps::width.
min_height: LengthLower bound for LayoutProps::height.
max_width: LengthUpper bound for LayoutProps::width.
max_height: LengthUpper bound for LayoutProps::height.
padding: Edges<Length>Space between the node’s edge and its children.
margin: Edges<Length>Space around the node, outside its border.
gap: SizeSpace between adjacent children.
align_items: Option<Align>Cross axis alignment for this node’s children. None leaves the layout
engine’s default, which stretches children across the cross axis.
justify_content: Option<Justify>Main axis distribution of this node’s children. None leaves the
layout engine’s default, which packs them against the start.
position: PositionWhether the node stays in normal flow.
inset: Edges<Length>Offsets from the containing block’s edges. They position an absolutely positioned node and shift a relatively positioned one from its flow position.
border_width: Edges<f32>Border thickness inside the node’s edge. The border takes space away
from the content and is painted in PaintProps::border_color.
overflow: OverflowWhether content that does not fit is clipped. This also affects the automatic minimum size of a flex item, so it is a layout property.
Trait Implementations§
Source§impl Clone for LayoutProps
impl Clone for LayoutProps
Source§impl Debug for LayoutProps
impl Debug for LayoutProps
Source§impl Default for LayoutProps
impl Default for LayoutProps
Source§fn default() -> LayoutProps
fn default() -> LayoutProps
A flex row that is sized by its content, does not grow, shrinks freely
and takes no space beyond its children. These are the layout engine’s
defaults, with the exception of Position::Relative, which this crate
uses so that every node is a containing block for its own children.