[][src]Trait pugl_ui::layout::Layouter

pub trait Layouter: Default + Clone + Copy {
    type Target;
    type Implementor: LayouterImpl;
    fn new_implementor() -> Box<dyn LayouterImpl>;
fn pack(
        &mut self,
        layout_impl: &mut Self::Implementor,
        subnode_id: Id,
        target: Self::Target
    );
fn expandable() -> (bool, bool); }

A trait describing layouters in order to assign them to a LayoutWidget.

Associated Types

type Target

A type to describe the target where the Layouter is supposed to put the widget.

type Implementor: LayouterImpl

The actual layout performing type

Loading content...

Required methods

fn new_implementor() -> Box<dyn LayouterImpl>

Supposed to create a heap allocated instance of the Implementor type.

fn pack(
    &mut self,
    layout_impl: &mut Self::Implementor,
    subnode_id: Id,
    target: Self::Target
)

Supposed to register the widget subnode_id

fn expandable() -> (bool, bool)

Supposed to indicate if the layout is expandable

The return value is a tuple (bool, bool), the first for the x-direction, the second for the y-direction

Loading content...

Implementors

impl Layouter for HorizontalLayouter[src]

type Target = StackDirection

type Implementor = HorizontalLayouterImpl

impl Layouter for VerticalLayouter[src]

type Target = StackDirection

type Implementor = VerticalLayouterImpl

Loading content...