[][src]Struct druid::widget::align::Align

pub struct Align<T: Data + 'static + Default> {
    id: WidgetId,
    align: UnitPoint,
    child: WidgetPod<T, WidgetBox<T>>,
    width_factor: Option<f64>,
    height_factor: Option<f64>,
}

A widget that aligns its child.

Fields

id: WidgetIdalign: UnitPointchild: WidgetPod<T, WidgetBox<T>>width_factor: Option<f64>height_factor: Option<f64>

Methods

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

pub fn new<W: Widget<T> + Clone>(align: UnitPoint, child: W) -> Align<T>[src]

Create widget with alignment.

Note that the align parameter is specified as a UnitPoint in terms of left and right. This is inadequate for bidi-aware layout and thus the API will change when druid gains bidi capability.

pub fn centered<W: Widget<T> + Clone>(child: W) -> Align<T>[src]

Create centered widget.

pub fn right<W: Widget<T> + Clone>(child: W) -> Align<T>[src]

Create right-aligned widget.

pub fn left<W: Widget<T> + Clone>(child: W) -> Align<T>[src]

Create left-aligned widget.

pub fn horizontal<W: Widget<T> + Clone>(align: UnitPoint, child: W) -> Align<T>[src]

Align only in the horizontal axis, keeping the child's size in the vertical.

pub fn vertical<W: Widget<T> + Clone>(align: UnitPoint, child: W) -> Align<T>[src]

Align only in the vertical axis, keeping the child's size in the horizontal.

Trait Implementations

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

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

Auto Trait Implementations

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

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

impl<T> Unpin for Align<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.