pub enum Background {
None,
Color(Color),
Image(ImageData, Color),
Patch(Patch, Color),
}
Expand description
Generic background definition
Variants§
None
Draw no background
Color(Color)
Draw a solid color
Image(ImageData, Color)
Draw a stretched image multiplied by a color
Patch(Patch, Color)
Draw a 9 patch image multiplied by a color
Implementations§
Source§impl Background
impl Background
Sourcepub fn content_rect(&self, layout: Rectangle, padding: Rectangle) -> Rectangle
pub fn content_rect(&self, layout: Rectangle, padding: Rectangle) -> Rectangle
Content rect for a given size and padding
Sourcepub fn layout_rect(
&self,
content_rect: Rectangle,
padding: Rectangle,
) -> Rectangle
pub fn layout_rect( &self, content_rect: Rectangle, padding: Rectangle, ) -> Rectangle
Layout rect for a given content size and padding.
This is the inverse of content_rect
Sourcepub fn resolve_size(
&self,
widget: (Size, Size),
content: (Size, Size),
padding: Rectangle,
) -> (Size, Size)
pub fn resolve_size( &self, widget: (Size, Size), content: (Size, Size), padding: Rectangle, ) -> (Size, Size)
Resolve the size of a widget when taking this background and padding into account
Sourcepub fn minimum_size(&self) -> (f32, f32)
pub fn minimum_size(&self) -> (f32, f32)
Size of the background if the content rect is zero sized
Trait Implementations§
Source§impl Clone for Background
impl Clone for Background
Source§fn clone(&self) -> Background
fn clone(&self) -> Background
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for Background
impl RefUnwindSafe for Background
impl Send for Background
impl Sync for Background
impl Unpin for Background
impl UnwindSafe for Background
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