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§
source§impl 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§
source§impl Directional for AxisInfo
impl Directional for AxisInfo
source§fn as_direction(self) -> Direction
fn as_direction(self) -> Direction
Direction
enumsource§fn is_vertical(self) -> bool
fn is_vertical(self) -> bool
source§fn is_horizontal(self) -> bool
fn is_horizontal(self) -> bool
source§fn is_reversed(self) -> bool
fn is_reversed(self) -> bool
source§impl From<AxisInfo> for Directions
impl From<AxisInfo> for Directions
source§fn from(axis: AxisInfo) -> Directions
fn from(axis: AxisInfo) -> Directions
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§
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<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.