Skip to main content

CornerRadiusExt

Trait CornerRadiusExt 

Source
pub trait CornerRadiusExt: Sized {
    // Required method
    fn with_corner_radius(self, corner_radius: f32) -> Self;

    // Provided methods
    fn rounded_none(self) -> Self { ... }
    fn rounded(self) -> Self { ... }
    fn rounded_sm(self) -> Self { ... }
    fn rounded_md(self) -> Self { ... }
    fn rounded_lg(self) -> Self { ... }
    fn rounded_xl(self) -> Self { ... }
    fn rounded_2xl(self) -> Self { ... }
    fn rounded_3xl(self) -> Self { ... }
    fn rounded_4xl(self) -> Self { ... }
    fn rounded_full(self) -> Self { ... }
}
Expand description

Shorthand methods for setting an element’s CornerRadius to common values.

Required Methods§

Source

fn with_corner_radius(self, corner_radius: f32) -> Self

Round all four corners to the given radius in pixels.

Provided Methods§

Source

fn rounded_none(self) -> Self

Shortcut for corner_radius(0.) - removes border radius.

Source

fn rounded(self) -> Self

Shortcut for corner_radius(6.) - default border radius.

Source

fn rounded_sm(self) -> Self

Shortcut for corner_radius(4.) - small border radius.

Source

fn rounded_md(self) -> Self

Shortcut for corner_radius(6.) - medium border radius.

Source

fn rounded_lg(self) -> Self

Shortcut for corner_radius(8.) - large border radius.

Source

fn rounded_xl(self) -> Self

Shortcut for corner_radius(12.) - extra large border radius.

Source

fn rounded_2xl(self) -> Self

Shortcut for corner_radius(16.) - extra large border radius.

Source

fn rounded_3xl(self) -> Self

Shortcut for corner_radius(24.) - extra large border radius.

Source

fn rounded_4xl(self) -> Self

Shortcut for corner_radius(32.) - extra large border radius.

Source

fn rounded_full(self) -> Self

Shortcut for corner_radius(99.) - fully rounded (pill shape).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§