[][src]Enum gtk::Align

#[non_exhaustive]pub enum Align {
    // some variants omitted

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 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 Align::Start and Align::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 Align::Fill.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

stretch to fill all space if possible, center if no meaningful way to stretch


snap to left or top side, leaving space on right or bottom


snap to right or bottom side, leaving space on left or top


center natural width of widget inside the allocation


align the widget according to the baseline. Since 3.10.

Trait Implementations

impl Clone for Align[src]

impl Copy for Align[src]

impl Debug for Align[src]

impl Display for Align[src]

impl Eq for Align[src]

impl<'a> FromValue<'a> for Align[src]

impl<'a> FromValueOptional<'a> for Align[src]

impl Hash for Align[src]

impl Ord for Align[src]

impl PartialEq<Align> for Align[src]

impl PartialOrd<Align> for Align[src]

impl SetValue for Align[src]

impl StaticType for Align[src]

impl StructuralEq for Align[src]

impl StructuralPartialEq for Align[src]

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

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized

impl<T> ToString for T where
    T: Display + ?Sized

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.