pub struct ParentData {
pub weight: f32,
pub fill: bool,
pub box_alignment: Option<Alignment>,
pub row_alignment: Option<VerticalAlignment>,
pub row_baseline: bool,
pub column_alignment: Option<HorizontalAlignment>,
pub fill_width_fraction: f32,
pub fill_height_fraction: f32,
pub layout_data: Option<Rc<dyn LayoutData>>,
}Expand description
Layout metadata supplied by a child for its direct parent.
Weight/fill apply to Row and Column. Alignment values override the corresponding parent layout’s default alignment for this child only.
Fields§
§weight: f32The child’s share of a Row’s or Column’s room left over; 0 for none.
fill: boolWhether a weighted child fills its share or may be smaller.
box_alignment: Option<Alignment>Where the child sits in a Box, over the Box’s own alignment.
row_alignment: Option<VerticalAlignment>Where the child sits across a Row, over the Row’s own alignment.
row_baseline: boolAligns this child’s first baseline with other baseline-aligned Row children.
column_alignment: Option<HorizontalAlignment>Where the child sits across a Column, over the Column’s own alignment.
fill_width_fraction: f32The fraction of the parent’s width the child’s outermost horizontal
fill modifier asks for; 0 without one. A FlexBox reads it as the
child’s default grow. Compose’s FillModifierParentData.
fill_height_fraction: f32The same for height.
layout_data: Option<Rc<dyn LayoutData>>The data of the child’s outermost LayoutData modifier, for a
parent that reads it by its type.
Implementations§
Source§impl ParentData
impl ParentData
Sourcepub fn has_weight(&self) -> bool
pub fn has_weight(&self) -> bool
Whether the child takes a share of the room left over.
Sourcepub fn layout_data<T: Any>(&self) -> Option<&T>
pub fn layout_data<T: Any>(&self) -> Option<&T>
The child’s LayoutData when it is a T.