Skip to main content

StyleExt

Trait StyleExt 

Source
pub trait StyleExt
where 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§

Source

fn get_style(&mut self) -> &mut StyleState

Returns a mutable reference to the element’s style data.

Provided Methods§

Source

fn background(self, background: impl Into<Fill>) -> Self

Paint the background with any Fill: a Color, a gradient or a shader.

Source

fn border(self, border: impl Into<Option<Border>>) -> Self

Add an outline around the element. See Border.

Source

fn shadow(self, shadow: impl Into<Shadow>) -> Self

Add a shadow cast by the element. See Shadow.

Source

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".

Implementors§