pub struct Layout {
pub x_alignment: Alignment,
pub y_alignment: Alignment,
pub x_offset: f32,
pub y_offset: f32,
pub x_size: Size,
pub y_size: Size,
pub padding: (f32, f32, f32, f32),
pub preserve_ratio: bool,
}
Expand description
A struct that contains information about the layout of an UI-Element: their alignment, size, offset and padding.
Fields§
§x_alignment: Alignment
Wether this element aligns left, center or right. See Alignment.
y_alignment: Alignment
Wether this element aligns top, center or bottom. See Alignment.
x_offset: f32
How many pixels away from the most left- or rightmost position this element aligns. Should be positive. Does not work with Alignment::Center.
y_offset: f32
How many pixels away from the most top- or bottommost position this element aligns. Should be positive. Does not work with Alignment::Center.
x_size: Size
The size and growth behaviour of this element in the horizontal direction. See Size.
y_size: Size
The size and growth behaviour of this element in the vertical direction. See Size.
padding: (f32, f32, f32, f32)
Specifies the padding, extra space around the cental element(s), of a container in the order top, right, bottom, left.
preserve_ratio: bool
Specifies wether this elements content will only receive draw rectangles in the size of their content min ratio.
Implementations§
Trait Implementations§
impl Copy for Layout
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnwindSafe for Layout
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> HasMut<T> for T
impl<T> HasMut<T> for T
Source§fn retrieve_mut(&mut self) -> &mut T
fn retrieve_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more