Trait cushy::widget::MakeWidgetList

source ·
pub trait MakeWidgetList: Sized {
    // Required method
    fn make_widget_list(self) -> WidgetList;

    // Provided methods
    fn and<W>(self, widget: W) -> WidgetList
       where W: MakeWidget { ... }
    fn into_rows(self) -> Stack { ... }
    fn into_columns(self) -> Stack { ... }
    fn into_layers(self) -> Layers { ... }
    fn into_wrap(self) -> Wrap { ... }
    fn into_list(self) -> List { ... }
}
Expand description

Allows to convert collections or iterators directly into Stack, Layers, etc.

use cushy::widget::{MakeWidget, MakeWidgetList};

vec!["hello", "label"].into_rows();

vec!["hello", "button"]
    .into_iter()
    .map(|l| l.into_button())
    .into_columns();

Required Methods§

source

fn make_widget_list(self) -> WidgetList

Returns self as a WidgetList.

Provided Methods§

source

fn and<W>(self, widget: W) -> WidgetList
where W: MakeWidget,

Adds widget to self and returns the updated list.

source

fn into_rows(self) -> Stack

Returns self as a vertical Stack of rows.

source

fn into_columns(self) -> Stack

Returns self as a horizontal Stack of columns.

source

fn into_layers(self) -> Layers

Returns self as Layers, with the widgets being stacked in the Z direction.

source

fn into_wrap(self) -> Wrap

Returns a Wrap that lays the children out horizontally, wrapping into additional rows as needed.

source

fn into_list(self) -> List

Returns self as an unordered List.

Object Safety§

This trait is not object safe.

Implementors§