#[non_exhaustive]pub enum Align {
Fill,
Start,
End,
Center,
Baseline,
BaselineFill,
BaselineCenter,
}
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 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 GTK_ALIGN_START
and GTK_ALIGN_END
are interpreted relative to text direction.
Baseline support is optional for containers and widgets, and is only available
for vertical alignment. GTK_ALIGN_BASELINE_CENTER and
GTK_ALIGN_BASELINE_FILLare treated similar to
GTK_ALIGN_CENTERand
GTK_ALIGN_FILL`, except that it
positions the widget to line up the baselines, where that is supported.
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.
Use GTK_ALIGN_BASELINE_FILL
instead
BaselineFill
v4_12
only.a different name for GTK_ALIGN_BASELINE
.
BaselineCenter
v4_12
only.stretch to fill all space, but align the baseline.
Trait Implementations§
source§impl<'a> FromValue<'a> for Align
impl<'a> FromValue<'a> for Align
source§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 HasParamSpec for Align
impl HasParamSpec for Align
source§impl Ord for Align
impl Ord for Align
source§impl PartialOrd for Align
impl PartialOrd for Align
source§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 StructuralPartialEq for Align
Auto Trait Implementations§
impl Freeze for Align
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> 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoClosureReturnValue for T
impl<T> IntoClosureReturnValue for T
fn into_closure_return_value(self) -> Option<Value>
source§impl<T> PropertyGet for Twhere
T: HasParamSpec,
impl<T> PropertyGet for Twhere
T: HasParamSpec,
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> ToSendValue for T
impl<T> ToSendValue for T
source§fn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
SendValue
clone of self
.