pub struct AxisInfo { /* private fields */ }Expand description
Information on which axis is being resized
Also conveys the size of the other axis, if fixed.
Implementations
sourceimpl AxisInfo
impl AxisInfo
sourcepub fn new(vertical: bool, fixed: Option<i32>, align: Option<Align>) -> Self
pub fn new(vertical: bool, fixed: Option<i32>, align: Option<Align>) -> Self
Construct with direction and an optional value for the other axis
This method is usually not required by user code.
sourcepub fn with_align_hints(self, hints: AlignHints) -> Self
pub fn with_align_hints(self, hints: AlignHints) -> Self
Construct a copy using the given alignment hints
sourcepub fn is_vertical(self) -> bool
pub fn is_vertical(self) -> bool
True if the current axis is vertical
sourcepub fn is_horizontal(self) -> bool
pub fn is_horizontal(self) -> bool
True if the current axis is horizontal
sourcepub fn set_default_align(&mut self, align: Align)
pub fn set_default_align(&mut self, align: Align)
Set default alignment
If the optional alignment parameter is None, replace with align.
sourcepub fn set_default_align_hv(&mut self, horiz: Align, vert: Align)
pub fn set_default_align_hv(&mut self, horiz: Align, vert: Align)
Set default alignment
If the optional alignment parameter is None, replace with either
horiz or vert depending on this axis’ orientation.
sourcepub fn align_or_default(self) -> Align
pub fn align_or_default(self) -> Align
Get align parameter, defaulting to Align::Default
sourcepub fn align_or_center(self) -> Align
pub fn align_or_center(self) -> Align
Get align parameter, defaulting to Align::Center
sourcepub fn align_or_stretch(self) -> Align
pub fn align_or_stretch(self) -> Align
Get align parameter, defaulting to Align::Stretch
sourcepub fn size_other_if_fixed(&self, vertical: bool) -> Option<i32>
pub fn size_other_if_fixed(&self, vertical: bool) -> Option<i32>
Size of other axis, if fixed and vertical matches this axis.
Trait Implementations
sourceimpl Directional for AxisInfo
impl Directional for AxisInfo
sourcefn as_direction(self) -> Direction
fn as_direction(self) -> Direction
Convert to the Direction enum
sourcefn is_vertical(self) -> bool
fn is_vertical(self) -> bool
Up or Down
sourcefn is_horizontal(self) -> bool
fn is_horizontal(self) -> bool
Left or Right
sourcefn is_reversed(self) -> bool
fn is_reversed(self) -> bool
Left or Up
sourceimpl From<AxisInfo> for Directions
impl From<AxisInfo> for Directions
sourcefn from(axis: AxisInfo) -> Directions
fn from(axis: AxisInfo) -> Directions
Converts to this type from the input type.
impl Copy for AxisInfo
Auto Trait Implementations
impl RefUnwindSafe for AxisInfo
impl Send for AxisInfo
impl Sync for AxisInfo
impl Unpin for AxisInfo
impl UnwindSafe for AxisInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
sourcefn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Try approximate conversion from Self to T Read more
sourcefn cast_approx(self) -> T
fn cast_approx(self) -> T
Cast approximately from Self to T Read more
sourceimpl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
sourcefn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Cast to integer, truncating Read more
sourcefn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Cast to the nearest integer Read more
sourcefn cast_floor(self) -> T
fn cast_floor(self) -> T
Cast the floor to an integer Read more
sourcefn try_cast_trunc(self) -> Result<T, Error>
fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
sourcefn try_cast_nearest(self) -> Result<T, Error>
fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
sourcefn try_cast_floor(self) -> Result<T, Error>
fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
sourcefn try_cast_ceil(self) -> Result<T, Error>
fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more