pub struct StackParentData {
pub top: Option<f64>,
pub right: Option<f64>,
pub bottom: Option<f64>,
pub left: Option<f64>,
pub width: Option<f64>,
pub height: Option<f64>,
/* private fields */
}Expand description
Parent data for use with RenderStack.
Fields§
§top: Option<f64>The distance by which the child’s top edge is inset from the top of the stack.
right: Option<f64>The distance by which the child’s right edge is inset from the right of the stack.
bottom: Option<f64>The distance by which the child’s bottom edge is inset from the bottom of the stack.
left: Option<f64>The distance by which the child’s left edge is inset from the left of the stack.
width: Option<f64>§height: Option<f64>Implementations§
Source§impl StackParentData
impl StackParentData
Sourcepub const fn new() -> StackParentData
pub const fn new() -> StackParentData
Creates stack parent data for a non-positioned child.
Sourcepub fn rect(&self) -> RelativeRect
pub fn rect(&self) -> RelativeRect
Sourcepub fn set_rect(&mut self, value: RelativeRect)
pub fn set_rect(&mut self, value: RelativeRect)
Sets rect.
Sourcepub fn is_positioned(&self) -> bool
pub fn is_positioned(&self) -> bool
Whether this child is considered positioned.
A child is positioned if any of the top, right, bottom, or left properties are non-null. Positioned children do not factor into determining the size of the stack but are instead placed relative to the non-positioned children in the stack.
Sourcepub fn positioned_child_constraints(&self, stack_size: Size) -> BoxConstraints
pub fn positioned_child_constraints(&self, stack_size: Size) -> BoxConstraints
Computes the BoxConstraints the stack layout algorithm would give to this child,
given the Size of the stack.
This method should only be called when is_positioned is true for
the child.
Trait Implementations§
Source§impl ContainerBoxParentData for StackParentData
impl ContainerBoxParentData for StackParentData
Source§fn box_parent_data(&self) -> &BoxParentData
fn box_parent_data(&self) -> &BoxParentData
BoxParentData half. Read moreSource§fn box_parent_data_mut(&mut self) -> &mut BoxParentData
fn box_parent_data_mut(&mut self) -> &mut BoxParentData
box_parent_data.Source§fn offset(&self) -> Offset
fn offset(&self) -> Offset
Source§fn set_offset(&mut self, value: Offset)
fn set_offset(&mut self, value: Offset)
offset.Source§impl ContainerParentDataMixin for StackParentData
impl ContainerParentDataMixin for StackParentData
Source§type ChildType = AnyRenderBox
type ChildType = AnyRenderBox
AnyRenderBox for a box container.Source§fn container_parent_data(&self) -> &ContainerParentData<AnyRenderBox>
fn container_parent_data(&self) -> &ContainerParentData<AnyRenderBox>
Source§fn container_parent_data_mut(
&mut self,
) -> &mut ContainerParentData<AnyRenderBox>
fn container_parent_data_mut( &mut self, ) -> &mut ContainerParentData<AnyRenderBox>
Source§fn previous_sibling(&self) -> Option<Self::ChildType>
fn previous_sibling(&self) -> Option<Self::ChildType>
Source§fn set_previous_sibling(&mut self, value: Option<Self::ChildType>)
fn set_previous_sibling(&mut self, value: Option<Self::ChildType>)
previous_sibling.Source§fn next_sibling(&self) -> Option<Self::ChildType>
fn next_sibling(&self) -> Option<Self::ChildType>
Source§fn set_next_sibling(&mut self, value: Option<Self::ChildType>)
fn set_next_sibling(&mut self, value: Option<Self::ChildType>)
next_sibling.