Enum acrylic::core::visual::LayoutMode
source · pub enum LayoutMode {
Unset,
WrapContent,
Fixed(Pixels),
Chunks(Pixels),
AspectRatio(Ratio),
Remaining(Ratio),
}Expand description
Possible ways for a node to be positioned
Variants§
Unset
Node will be ignored by the layout algorithm
WrapContent
Main length is just enough to contain all children. Valid for containers only.
Fixed(Pixels)
Main length is a fixed number of pixels.
Chunks(Pixels)
Main length is divided in chunks of specified length (in pixels). The number of chunks is determined by the contained nodes: there will be as many chunks as necessary for all children to fit in. For this to work, the node must be:
- A vertical container in an vorizontal container, or
- An horizontal container in a vertical container.
AspectRatio(Ratio)
Main length is computed from the cross length so that the size of the node maintains a certain aspect ratio.
Remaining(Ratio)
After neighbors with a different policy are layed
out, nodes with this policy are layed-out so that
they occupy the remaining space in their container.
The Ratio is the relative “weight” of this node:
heavier nodes will get more space, lighter nodes
will get less space. If they all have the same
weight, they will all get the same space.
Trait Implementations§
source§impl Clone for LayoutMode
impl Clone for LayoutMode
source§fn clone(&self) -> LayoutMode
fn clone(&self) -> LayoutMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for LayoutMode
impl Debug for LayoutMode
source§impl Default for LayoutMode
impl Default for LayoutMode
source§fn default() -> LayoutMode
fn default() -> LayoutMode
source§impl PartialEq<LayoutMode> for LayoutMode
impl PartialEq<LayoutMode> for LayoutMode
source§fn eq(&self, other: &LayoutMode) -> bool
fn eq(&self, other: &LayoutMode) -> bool
self and other values to be equal, and is used
by ==.