[−][src]Enum pixel_widgets::draw::Background
Generic background definition
Variants
Draw no background
Color(Color)
Draw a solid color
Draw a stretched image multiplied by a color
Draw a 9 patch image multiplied by a color
Implementations
impl Background
[src]
pub fn content_rect(&self, layout: Rectangle, padding: Rectangle) -> Rectangle
[src]
Content rect for a given size and padding
pub fn layout_rect(
&self,
content_rect: Rectangle,
padding: Rectangle
) -> Rectangle
[src]
&self,
content_rect: Rectangle,
padding: Rectangle
) -> Rectangle
Layout rect for a given content size and padding.
This is the inverse of content_rect
pub fn resolve_size(
&self,
widget: (Size, Size),
content: (Size, Size),
padding: Rectangle
) -> (Size, Size)
[src]
&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
pub fn minimum_size(&self) -> (f32, f32)
[src]
Size of the background if the content rect is zero sized
pub fn padding(&self) -> Rectangle
[src]
Padding of the background. Only defined for 9 patch backgrounds, other backgrounds have no padding.
pub fn is_solid(&self) -> bool
[src]
Returns whether the background is visible
pub fn render(&self, rectangle: Rectangle) -> Option<Primitive<'static>>
[src]
Convert background to Some(Primitive)
,
or None
if this background is None
Trait Implementations
impl Clone for Background
[src]
fn clone(&self) -> Background
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for Background
impl Send for Background
impl Sync for Background
impl Unpin for Background
impl UnwindSafe for Background
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CloneAny for T where
T: Clone + Any,
T: Clone + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,