[][src]Struct druid::widget::flex::Flex

pub struct Flex<T: Data + 'static + Default> {
    id: WidgetId,
    direction: Axis,
    children: Vec<ChildWidget<T>, U8>,
}

A container with either horizontal or vertical layout.

Fields

id: WidgetIddirection: Axischildren: Vec<ChildWidget<T>, U8>

Methods

impl<T: Data + 'static + Default> Flex<T>[src]

pub fn add_child<W: Widget<T> + Clone>(&mut self, child: W, flex: f64)[src]

Add a child widget.

If flex is zero, then the child is non-flex. It is given the same constraints on the "minor axis" as its parent, but unconstrained on the "major axis".

If flex is non-zero, then all the space left over after layout of the non-flex children is divided up, in proportion to the flex value, among the flex children.

Trait Implementations

impl<T: Clone + Data + 'static + Default> Clone for Flex<T>[src]

impl<T: Data + 'static + Default> Widget<T> for Flex<T>[src]

Auto Trait Implementations

impl<T> Send for Flex<T> where
    T: Send

impl<T> Sync for Flex<T> where
    T: Sync

impl<T> Unpin for Flex<T> where
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> RoundFrom<T> for T[src]

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.