Trait StyleExt
pub trait StyleExt: Sized {
// Required method
fn get_style(&mut self) -> &mut StyleState;
// Provided methods
fn background(self, background: impl Into<Fill>) -> Self { ... }
fn border(self, border: impl Into<Option<Border>>) -> Self { ... }
fn shadow(self, shadow: impl Into<Shadow>) -> Self { ... }
fn corner_radius(self, corner_radius: impl Into<CornerRadius>) -> Self { ... }
}Expand description
Methods for styling an element’s box: background, borders, shadows and corners.
Required Methods§
fn get_style(&mut self) -> &mut StyleState
fn get_style(&mut self) -> &mut StyleState
Returns a mutable reference to the element’s style data.
Provided Methods§
fn background(self, background: impl Into<Fill>) -> Self
fn background(self, background: impl Into<Fill>) -> Self
fn border(self, border: impl Into<Option<Border>>) -> Self
fn border(self, border: impl Into<Option<Border>>) -> Self
Add an outline around the element. See Border.
fn corner_radius(self, corner_radius: impl Into<CornerRadius>) -> Self
fn corner_radius(self, corner_radius: impl Into<CornerRadius>) -> Self
Round the element’s corners. See CornerRadius.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.