Trait StyleExt
pub trait StyleExt: Sized {
// Required method
fn get_style(&mut self) -> &mut StyleState;
// Provided methods
fn background<S>(self, background: S) -> Self
where S: Into<Color> { ... }
fn background_conic_gradient<S>(self, background: S) -> Self
where S: Into<ConicGradient> { ... }
fn background_linear_gradient<S>(self, background: S) -> Self
where S: Into<LinearGradient> { ... }
fn background_radial_gradient<S>(self, background: S) -> Self
where S: Into<RadialGradient> { ... }
fn background_shader(self, background: impl Into<ShaderFill>) -> 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<S>(self, background: S) -> Self
fn background<S>(self, background: S) -> Self
Set the background to a solid Color.
fn background_conic_gradient<S>(self, background: S) -> Selfwhere
S: Into<ConicGradient>,
fn background_conic_gradient<S>(self, background: S) -> Selfwhere
S: Into<ConicGradient>,
Paint the background with a ConicGradient.
fn background_linear_gradient<S>(self, background: S) -> Selfwhere
S: Into<LinearGradient>,
fn background_linear_gradient<S>(self, background: S) -> Selfwhere
S: Into<LinearGradient>,
Paint the background with a LinearGradient.
fn background_radial_gradient<S>(self, background: S) -> Selfwhere
S: Into<RadialGradient>,
fn background_radial_gradient<S>(self, background: S) -> Selfwhere
S: Into<RadialGradient>,
Paint the background with a RadialGradient.
fn background_shader(self, background: impl Into<ShaderFill>) -> Self
fn background_shader(self, background: impl Into<ShaderFill>) -> Self
Paint the background with a custom shader. See ShaderFill.
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.