#[non_exhaustive]
pub enum Align {
Fill,
Start,
End,
Center,
Baseline,
// some variants omitted
}
Expand description
Controls how a widget deals with extra space in a single dimension.
Alignment only matters if the widget receives a “too large” allocation,
for example if you packed the widget with the property::Widget::hexpand
property inside a Box
, then the widget might get extra space.
If you have for example a 16x16 icon inside a 32x32 space, the icon
could be scaled and stretched, it could be centered, or it could be
positioned to one side of the space.
Note that in horizontal context Start
and End
are interpreted relative to text direction.
Baseline
support is optional for containers and widgets, and
it is only supported for vertical alignment. When it’s not supported by
a child or a container it is treated as Fill
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Fill
stretch to fill all space if possible, center if no meaningful way to stretch
Start
snap to left or top side, leaving space on right or bottom
End
snap to right or bottom side, leaving space on left or top
Center
center natural width of widget inside the allocation
Baseline
align the widget according to the baseline.
See Widget
.
Trait Implementations§
source§impl<'a> FromValue<'a> for Align
impl<'a> FromValue<'a> for Align
§type Checker = GenericValueTypeChecker<Align>
type Checker = GenericValueTypeChecker<Align>
source§unsafe fn from_value(value: &'a Value) -> Self
unsafe fn from_value(value: &'a Value) -> Self
Value
. Read moresource§impl Ord for Align
impl Ord for Align
source§impl PartialEq<Align> for Align
impl PartialEq<Align> for Align
source§impl PartialOrd<Align> for Align
impl PartialOrd<Align> for Align
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl StaticType for Align
impl StaticType for Align
source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Copy for Align
impl Eq for Align
impl StructuralEq for Align
impl StructuralPartialEq for Align
Auto Trait Implementations§
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> StaticTypeExt for Twhere
T: StaticType,
impl<T> StaticTypeExt for Twhere
T: StaticType,
source§fn ensure_type()
fn ensure_type()
source§impl<T> ToClosureReturnValue for Twhere
T: ToValue,
impl<T> ToClosureReturnValue for Twhere
T: ToValue,
fn to_closure_return_value(&self) -> Option<Value>
source§impl<T> ToSendValue for Twhere
T: Send + ToValue + ?Sized,
impl<T> ToSendValue for Twhere
T: Send + ToValue + ?Sized,
source§fn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
SendValue
clone of self
.