pub struct Align { /* private fields */ }
Expand description
A widget that aligns its child.
Implementations§
source§impl Align
impl Align
sourcepub fn new(align: UnitPoint, child: impl Widget + 'static) -> Align
pub fn new(align: UnitPoint, child: impl Widget + 'static) -> Align
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 Masonry gains bidi capability.
sourcepub fn horizontal(align: UnitPoint, child: impl Widget + 'static) -> Align
pub fn horizontal(align: UnitPoint, child: impl Widget + 'static) -> Align
Align only in the horizontal axis, keeping the child’s size in the vertical.
Trait Implementations§
source§impl Widget for Align
impl Widget for Align
source§fn on_pointer_event(&mut self, ctx: &mut EventCtx<'_>, event: &PointerEvent)
fn on_pointer_event(&mut self, ctx: &mut EventCtx<'_>, event: &PointerEvent)
Handle an event - usually user interaction. Read more
fn on_text_event(&mut self, ctx: &mut EventCtx<'_>, event: &TextEvent)
source§fn on_access_event(&mut self, ctx: &mut EventCtx<'_>, event: &AccessEvent)
fn on_access_event(&mut self, ctx: &mut EventCtx<'_>, event: &AccessEvent)
Handle an event from the platform’s accessibility API.
source§fn lifecycle(&mut self, ctx: &mut LifeCycleCtx<'_>, event: &LifeCycle)
fn lifecycle(&mut self, ctx: &mut LifeCycleCtx<'_>, event: &LifeCycle)
Handle a lifecycle notification. Read more
fn on_status_change( &mut self, _ctx: &mut LifeCycleCtx<'_>, _event: &StatusChange )
source§fn layout(&mut self, ctx: &mut LayoutCtx<'_>, bc: &BoxConstraints) -> Size
fn layout(&mut self, ctx: &mut LayoutCtx<'_>, bc: &BoxConstraints) -> Size
Compute layout. Read more
source§fn paint(&mut self, ctx: &mut PaintCtx<'_>, scene: &mut Scene)
fn paint(&mut self, ctx: &mut PaintCtx<'_>, scene: &mut Scene)
Paint the widget appearance. Read more
fn accessibility_role(&self) -> Role
fn accessibility(&mut self, ctx: &mut AccessCtx<'_>)
source§fn children(&self) -> SmallVec<[WidgetRef<'_, dyn Widget>; 16]>
fn children(&self) -> SmallVec<[WidgetRef<'_, dyn Widget>; 16]>
Return references to this widget’s children. Read more
source§fn make_trace_span(&self) -> Span
fn make_trace_span(&self) -> Span
Return a span for tracing. Read more
Auto Trait Implementations§
impl !Freeze for Align
impl !RefUnwindSafe for Align
impl !Send for Align
impl !Sync for Align
impl Unpin for Align
impl !UnwindSafe for Align
Blanket Implementations§
source§impl<T> AsAny for Twhere
T: Any,
impl<T> AsAny for Twhere
T: Any,
source§fn as_dyn_any(&self) -> &(dyn Any + 'static)
fn as_dyn_any(&self) -> &(dyn Any + 'static)
Return self.
source§fn as_mut_dyn_any(&mut self) -> &mut (dyn Any + 'static)
fn as_mut_dyn_any(&mut self) -> &mut (dyn Any + 'static)
Return self.
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more