pub struct LayoutStyle {Show 27 fields
pub display: Display,
pub overflow: (Overflow, Overflow),
pub scrollbar_width: f32,
pub position: Position,
pub inset: Rect<LengthPercentageAuto>,
pub size: Vector2<Dimension>,
pub min_size: Vector2<Dimension>,
pub max_size: Vector2<Dimension>,
pub aspect_ratio: Option<f32>,
pub margin: Rect<LengthPercentageAuto>,
pub padding: Rect<LengthPercentage>,
pub border: Rect<LengthPercentage>,
pub align_items: Option<AlignItems>,
pub align_self: Option<AlignSelf>,
pub justify_items: Option<AlignItems>,
pub justify_self: Option<AlignSelf>,
pub align_content: Option<AlignContent>,
pub justify_content: Option<JustifyContent>,
pub gap: Vector2<LengthPercentage>,
pub flex_direction: FlexDirection,
pub flex_wrap: FlexWrap,
pub flex_basis: Dimension,
pub flex_grow: f32,
pub flex_shrink: f32,
pub grid_auto_flow: GridAutoFlow,
pub grid_row: Line<GridPlacement>,
pub grid_column: Line<GridPlacement>,
}Expand description
Defines different aspects and properties of a widget layout.
Fields§
§display: DisplayWhat layout strategy should be used?
overflow: (Overflow, Overflow)How children overflowing their container should affect layout.
scrollbar_width: f32How much space (in points) should be reserved for scrollbars.
position: PositionWhat should the position value of this struct use as a base offset?
inset: Rect<LengthPercentageAuto>How should the position of this element be tweaked relative to the layout defined?
size: Vector2<Dimension>Sets the initial size of the item.
min_size: Vector2<Dimension>Controls the minimum size of the item.
max_size: Vector2<Dimension>Controls the maximum size of the item.
aspect_ratio: Option<f32>Sets the preferred aspect ratio for the item
The ratio is calculated as width divided by height.
margin: Rect<LengthPercentageAuto>How large should the margin be on each side?
padding: Rect<LengthPercentage>How large should the padding be on each side?
border: Rect<LengthPercentage>How large should the border be on each side?
align_items: Option<AlignItems>How this node’s children aligned in the cross/block axis?
align_self: Option<AlignSelf>How this node should be aligned in the cross/block axis Falls back to the parents AlignItems if not set.
justify_items: Option<AlignItems>How this node’s children should be aligned in the inline axis.
justify_self: Option<AlignSelf>How this node should be aligned in the inline axis Falls back to the parents JustifyItems if not set.
align_content: Option<AlignContent>How should content contained within this item be aligned in the cross/block axis?
justify_content: Option<JustifyContent>How should content contained within this item be aligned in the main/inline axis?
gap: Vector2<LengthPercentage>How large should the gaps between items in a grid or flex container be?
flex_direction: FlexDirectionWhich direction does the main axis flow in?
flex_wrap: FlexWrapShould elements wrap, or stay in a single line?
flex_basis: DimensionSets the initial main axis size of the item.
flex_grow: f32The relative rate at which this item grows when it is expanding to fill space.
0.0 is the default value, and this value must be positive.
flex_shrink: f32The relative rate at which this item shrinks when it is contracting to fit into space.
1.0 is the default value, and this value must be positive.
grid_auto_flow: GridAutoFlowControls how items get placed into the grid for auto-placed items.
grid_row: Line<GridPlacement>Defines which row in the grid the item should start and end at.
grid_column: Line<GridPlacement>Defines which column in the grid the item should start and end at.
Trait Implementations§
Source§impl Clone for LayoutStyle
impl Clone for LayoutStyle
Source§fn clone(&self) -> LayoutStyle
fn clone(&self) -> LayoutStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LayoutStyle
impl Debug for LayoutStyle
Source§impl Default for LayoutStyle
impl Default for LayoutStyle
Source§impl From<LayoutStyle> for Style
impl From<LayoutStyle> for Style
Source§fn from(value: LayoutStyle) -> Self
fn from(value: LayoutStyle) -> Self
Source§impl PartialEq for LayoutStyle
impl PartialEq for LayoutStyle
impl StructuralPartialEq for LayoutStyle
Auto Trait Implementations§
impl Freeze for LayoutStyle
impl RefUnwindSafe for LayoutStyle
impl !Send for LayoutStyle
impl !Sync for LayoutStyle
impl Unpin for LayoutStyle
impl UnwindSafe for LayoutStyle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.