[][src]Trait embedded_layout::layout::linear::SecondaryAlignment

pub trait SecondaryAlignment: Alignment {
    type First: Alignment;
    fn measure(prev: Size, view_size: Size) -> Size;
}

Secondary alignment is used to align views perpendicular to the placement axis.

For example, use horizontal::Right to align views to the right in a vertical linear layout.

SecondaryAlignment should be implemented by custom Alignment types, otherwise they won't be compatible with LinearLayout.

Associated Types

type First: Alignment

The secondary alignment of the first view

Loading content...

Required methods

fn measure(prev: Size, view_size: Size) -> Size

Return the combined Size occupied by both Views after they are arranged.

I.e. horizontal::Left returns the maximum width, while horizontal::LeftToRight returns the sum of the two widths.

Loading content...

Implementors

impl SecondaryAlignment for embedded_layout::align::horizontal::Center[src]

type First = Center

impl SecondaryAlignment for Left[src]

type First = Left

impl SecondaryAlignment for LeftToRight[src]

type First = Left

impl SecondaryAlignment for Right[src]

type First = Right

impl SecondaryAlignment for RightToLeft[src]

type First = Right

impl SecondaryAlignment for Bottom[src]

type First = Bottom

impl SecondaryAlignment for BottomToTop[src]

type First = Bottom

impl SecondaryAlignment for embedded_layout::align::vertical::Center[src]

type First = Center

impl SecondaryAlignment for Top[src]

type First = Top

impl SecondaryAlignment for TopToBottom[src]

type First = Top

Loading content...