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

pub trait Orientation: Copy + Clone {
    type Secondary: SecondaryAlignment + Alignment;
    fn destructure_size(size: Size) -> (u32, u32);
fn create_size(primary: u32, secondary: u32) -> Size;
fn adjust_size(self, size: Size, objects: u32) -> Size;
fn place_first(&self, view: &mut impl View, bounds: Rectangle, count: u32);
fn place_nth(
        &self,
        view: &mut impl View,
        size: Size,
        previous: Rectangle,
        n: u32,
        count: u32
    ); }

Helper trait that describes a linear layout orientation.

Associated Types

type Secondary: SecondaryAlignment + Alignment

Secondary alignment that will be applied to all the views

Loading content...

Required methods

fn destructure_size(size: Size) -> (u32, u32)

Destructure Size into (primary_size, secondary_size)

fn create_size(primary: u32, secondary: u32) -> Size

Create a Size from primary and secondary size values

fn adjust_size(self, size: Size, objects: u32) -> Size

Adjust measured size based on element spacing

fn place_first(&self, view: &mut impl View, bounds: Rectangle, count: u32)

Place first view

fn place_nth(
    &self,
    view: &mut impl View,
    size: Size,
    previous: Rectangle,
    n: u32,
    count: u32
)

Place nth view

Loading content...

Implementors

impl<Secondary, Spacing> Orientation for Horizontal<Secondary, Spacing> where
    Secondary: SecondaryAlignment + VerticalAlignment,
    Spacing: ElementSpacing
[src]

type Secondary = Secondary

impl<Secondary, Spacing> Orientation for Vertical<Secondary, Spacing> where
    Secondary: SecondaryAlignment + HorizontalAlignment,
    Spacing: ElementSpacing
[src]

type Secondary = Secondary

Loading content...