#[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 (x or y) dimension.
Alignment only matters if the widget receives a “too large” allocation,
for example if you packed the widget with the property::Widget::expand
flag 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.
GTK_ALIGN_BASELINE support for it is optional for containers and widgets, and
it is only supported for vertical alignment. When its 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. Since 3.10.
Trait Implementations
sourceimpl<'a> FromValue<'a> for Align
impl<'a> FromValue<'a> for Align
type Checker = GenericValueTypeChecker<Align>
type Checker = GenericValueTypeChecker<Align>
Value type checker.
sourceunsafe fn from_value(value: &'a Value) -> Self
unsafe fn from_value(value: &'a Value) -> Self
Get the contained value from a Value
. Read more
sourceimpl Ord for Align
impl Ord for Align
sourceimpl PartialOrd<Align> for Align
impl PartialOrd<Align> for Align
sourcefn partial_cmp(&self, other: &Align) -> Option<Ordering>
fn partial_cmp(&self, other: &Align) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl StaticType for Align
impl StaticType for Align
sourcefn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> StaticTypeExt for T where
T: StaticType,
impl<T> StaticTypeExt for T where
T: StaticType,
sourcefn ensure_type()
fn ensure_type()
Ensures that the type has been registered with the type system.
sourceimpl<T> ToClosureReturnValue for T where
T: ToValue,
impl<T> ToClosureReturnValue for T where
T: ToValue,
fn to_closure_return_value(&self) -> Option<Value>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> ToSendValue for T where
T: Send + ToValue + ?Sized,
impl<T> ToSendValue for T where
T: Send + ToValue + ?Sized,
sourcefn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
Returns a SendValue
clone of self
.