pub struct Layout(/* private fields */);
Expand description
Represents a layout tree which is the main building block of a UI in Zi.
Each node in the layout tree is one
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn container(
direction: FlexDirection,
items: impl IntoIterator<Item = Item>,
) -> Self
pub fn container( direction: FlexDirection, items: impl IntoIterator<Item = Item>, ) -> Self
Creates a new flex container with a specified direction and containing the provided items.
This is a utility function that builds a container and converts it to a Layout
.
It is equivalent to calling Container::new(direction, items).into()
.
Sourcepub fn column(items: impl IntoIterator<Item = Item>) -> Self
pub fn column(items: impl IntoIterator<Item = Item>) -> Self
Creates a container with column (vertical) layout.
Child components are laid out from top to bottom. Pass in the children as an something that can be converted to an iterator of items, e.g. an array of items.
This is a utility function that builds a container and converts it to a Layout
.
It is equivalent to calling Container::column(items).into()
.
Sourcepub fn column_reverse(items: impl IntoIterator<Item = Item>) -> Self
pub fn column_reverse(items: impl IntoIterator<Item = Item>) -> Self
Creates a container with reversed column (vertical) layout.
Child components are laid out from bottom to top. Pass in the children as an something that can be converted to an iterator of items, e.g. an array of items.
This is a utility function that builds a container and converts it to a Layout
.
It is equivalent to calling Container::column_reverse(items).into()
.
Sourcepub fn row(items: impl IntoIterator<Item = Item>) -> Self
pub fn row(items: impl IntoIterator<Item = Item>) -> Self
Creates a container with row (horizontal) layout.
Child components are laid out from left to right. Pass in the children as an something that can be converted to an iterator of items, e.g. an array of items.
This is a utility function that builds a container and converts it to a Layout
.
It is equivalent to calling Container::row(items).into()
.
Sourcepub fn row_reverse(items: impl IntoIterator<Item = Item>) -> Self
pub fn row_reverse(items: impl IntoIterator<Item = Item>) -> Self
Creates a container with reversed row (horizontal) layout.
Child components are laid out from right to left. Pass in the children as an something that can be converted to an iterator of items, e.g. an array of items.
This is a utility function that builds a container and converts it to a Layout
.
It is equivalent to calling Container::row_reverse(items).into()
.