[−][src]Struct druid::widget::Align
A widget that aligns its child.
Implementations
impl<T> Align<T>
[src]
pub fn new(align: UnitPoint, child: impl Widget<T> + 'static) -> 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(child: impl Widget<T> + 'static) -> Align<T>
[src]
Create centered widget.
pub fn right(child: impl Widget<T> + 'static) -> Align<T>
[src]
Create right-aligned widget.
pub fn left(child: impl Widget<T> + 'static) -> Align<T>
[src]
Create left-aligned widget.
pub fn horizontal(align: UnitPoint, child: impl Widget<T> + 'static) -> Align<T>
[src]
Align only in the horizontal axis, keeping the child's size in the vertical.
pub fn vertical(align: UnitPoint, child: impl Widget<T> + 'static) -> Align<T>
[src]
Align only in the vertical axis, keeping the child's size in the horizontal.
Trait Implementations
impl<T: Data> Widget<T> for Align<T>
[src]
fn event(&mut self, ctx: &mut EventCtx, event: &Event, data: &mut T, env: &Env)
[src]
fn lifecycle(
&mut self,
ctx: &mut LifeCycleCtx,
event: &LifeCycle,
data: &T,
env: &Env
)
[src]
&mut self,
ctx: &mut LifeCycleCtx,
event: &LifeCycle,
data: &T,
env: &Env
)
fn update(&mut self, ctx: &mut UpdateCtx, _old_data: &T, data: &T, env: &Env)
[src]
fn layout(
&mut self,
ctx: &mut LayoutCtx,
bc: &BoxConstraints,
data: &T,
env: &Env
) -> Size
[src]
&mut self,
ctx: &mut LayoutCtx,
bc: &BoxConstraints,
data: &T,
env: &Env
) -> Size
fn paint(&mut self, ctx: &mut PaintCtx, data: &T, env: &Env)
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Align<T>
impl<T> !Send for Align<T>
impl<T> !Sync for Align<T>
impl<T> Unpin for Align<T> where
T: Unpin,
T: Unpin,
impl<T> !UnwindSafe for Align<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> RoundFrom<T> for T
fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
fn round_into(self) -> U
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,