Enum widgetry::ContentMode
source · pub enum ContentMode {
ScaleToFill,
ScaleAspectFit,
ScaleAspectFill,
}
Expand description
Rules for how content should stretch to fill its bounds
Variants§
ScaleToFill
Stretches content to fit its bounds exactly, breaking aspect ratio as necessary.
ScaleAspectFit
Maintaining aspect ratio, content grows until it touches its bounds in one dimension. This is the default ContentMode.
If the aspect ratio of the bounds do not exactly match the aspect ratio of the content, then there will be some empty space within the bounds to center the content.
ScaleAspectFill
Maintaining aspect ratio, content grows until both bounds are met.
If the aspect ratio of the bounds do not exactly match the aspect ratio of the content, the content will overflow one dimension of its bounds.
Trait Implementations§
source§impl Clone for ContentMode
impl Clone for ContentMode
source§fn clone(&self) -> ContentMode
fn clone(&self) -> ContentMode
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ContentMode
impl Debug for ContentMode
source§impl Default for ContentMode
impl Default for ContentMode
impl Copy for ContentMode
Auto Trait Implementations§
impl Freeze for ContentMode
impl RefUnwindSafe for ContentMode
impl Send for ContentMode
impl Sync for ContentMode
impl Unpin for ContentMode
impl UnwindSafe for ContentMode
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
Mutably borrows from an owned value. Read more
§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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.