pub struct ContainerStyle {
pub axis: Axis,
pub gap: f32,
pub cross_gap: f32,
pub align: Align,
pub justify: Justify,
pub wrap: bool,
pub align_content: Align,
}Expand description
Layout style of a container that arranges its children on an axis.
Fields§
§axis: AxisMain axis along which children are placed.
gap: f32Gap between children along the main axis.
cross_gap: f32Gap between wrapped lines or cross-axis tracks.
align: AlignDefault cross-axis alignment for children.
justify: JustifyMain-axis distribution of free space.
wrap: boolWhether children wrap onto multiple lines.
align_content: AlignCross-axis alignment of wrapped lines within the container.
Implementations§
Source§impl ContainerStyle
impl ContainerStyle
Sourcepub fn new(axis: Axis, gap: f32) -> ContainerStyle
pub fn new(axis: Axis, gap: f32) -> ContainerStyle
Creates a style for axis with equal main and cross gaps.
Sourcepub fn gap(self, gap: f32) -> ContainerStyle
pub fn gap(self, gap: f32) -> ContainerStyle
Sets both the main and cross gaps.
Sourcepub fn main_gap(self, gap: f32) -> ContainerStyle
pub fn main_gap(self, gap: f32) -> ContainerStyle
Sets the main-axis gap.
Sourcepub fn cross_gap(self, gap: f32) -> ContainerStyle
pub fn cross_gap(self, gap: f32) -> ContainerStyle
Sets the cross-axis gap.
Sourcepub fn gaps(self, main: f32, cross: f32) -> ContainerStyle
pub fn gaps(self, main: f32, cross: f32) -> ContainerStyle
Sets the main and cross gaps independently.
Sourcepub fn align_items(self, align: Align) -> ContainerStyle
pub fn align_items(self, align: Align) -> ContainerStyle
Sets the default cross-axis alignment of children.
Sourcepub fn justify_content(self, justify: Justify) -> ContainerStyle
pub fn justify_content(self, justify: Justify) -> ContainerStyle
Sets the main-axis distribution of free space.
Sourcepub fn wrap(self, wrap: bool) -> ContainerStyle
pub fn wrap(self, wrap: bool) -> ContainerStyle
Enables or disables wrapping.
Sourcepub fn wrapped(self) -> ContainerStyle
pub fn wrapped(self) -> ContainerStyle
Enables wrapping.
Sourcepub fn align_content(self, align: Align) -> ContainerStyle
pub fn align_content(self, align: Align) -> ContainerStyle
Sets the cross-axis alignment of wrapped lines.
Sourcepub fn axis(self, axis: Axis) -> ContainerStyle
pub fn axis(self, axis: Axis) -> ContainerStyle
Sets the main axis.
Sourcepub fn main_gaps_total(self, count: usize) -> f32
pub fn main_gaps_total(self, count: usize) -> f32
Returns the total main-axis gap for count children.
Trait Implementations§
Source§impl Clone for ContainerStyle
impl Clone for ContainerStyle
Source§fn clone(&self) -> ContainerStyle
fn clone(&self) -> ContainerStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more