pub struct Align<A = ()> { /* private fields */ }Expand description
Aligns one child within allocated space using Flutter-like factors.
x and y range from -1 (start/top) through 0 (center) to 1
(end/bottom). Finite values are clamped to that interval; NaN remains
NaN and can propagate into layout offsets. With no child, the widget still
expands to its constrained maximum size.
§Examples
use ailloli_ui_widgets::{layout::Align, text::Text};
let centered: Align<()> = Align::new(0.0, 0.0).child(Text::new("center"));
let _ = centered;Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for Align<A>
impl<A = ()> !RefUnwindSafe for Align<A>
impl<A = ()> !Send for Align<A>
impl<A = ()> !Sync for Align<A>
impl<A> Unpin for Align<A>
impl<A = ()> !UnwindSafe for Align<A>
Blanket Implementations§
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
Source§impl<T, A> FlexItemExt<A> for Twhere
T: IntoView<A>,
impl<T, A> FlexItemExt<A> for Twhere
T: IntoView<A>,
Source§fn flex_grow_by(self, value: f32) -> View<A>
fn flex_grow_by(self, value: f32) -> View<A>
Sets the dimensionless flex-grow weight. Read more
Source§fn flex_shrink(self, value: f32) -> View<A>
fn flex_shrink(self, value: f32) -> View<A>
Sets the dimensionless flex-shrink weight. Read more
Source§fn flex_basis(self, value: impl Into<Length>) -> View<A>
fn flex_basis(self, value: impl Into<Length>) -> View<A>
Sets the preferred main-axis flex basis. Read more
Source§fn align_self(self, value: AlignItems) -> View<A>
fn align_self(self, value: AlignItems) -> View<A>
Overrides the parent cross-axis alignment for this view. Read more
Source§fn fill_width(self) -> View<A>
fn fill_width(self) -> View<A>
Marks width as parent-fill in the view size hint. Read more
Source§fn fill_height(self) -> View<A>
fn fill_height(self) -> View<A>
Marks height as parent-fill in the view size hint. Read more