pub trait StyleExtwhere
Self: 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§
Sourcefn 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§
Sourcefn background(self, background: impl Into<Fill>) -> Self
fn background(self, background: impl Into<Fill>) -> Self
Sourcefn 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.
Sourcefn shadow(self, shadow: impl Into<Shadow>) -> Self
fn shadow(self, shadow: impl Into<Shadow>) -> Self
Add a shadow cast by the element. See Shadow.
Sourcefn 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.