Styleable

Trait Styleable 

Source
pub trait Styleable: Widget + Sized {
    // Provided methods
    fn bg_color(self, c: Color) -> Self { ... }
    fn bg_opa(self, opa: u8) -> Self { ... }
    fn border_color(self, c: Color) -> Self { ... }
    fn border_width(self, w: i32) -> Self { ... }
    fn radius(self, r: i32) -> Self { ... }
    fn pad_all(self, p: i32) -> Self { ... }
    fn pad_hor(self, p: i32) -> Self { ... }
    fn pad_ver(self, p: i32) -> Self { ... }
    fn pad_gap(self, g: i32) -> Self { ... }
    fn text_color(self, c: Color) -> Self { ... }
    fn text_font(self, f: *const lv_font_t) -> Self { ... }
    fn add_style(self, style: &mut Style, selector: u32) -> Self { ... }
}
Expand description

Fluent inline style setters. Applied to LV_PART_MAIN by default. Blanket-implemented for all Widget types.

Provided Methods§

Source

fn bg_color(self, c: Color) -> Self

Set the background color of the widget’s main part.

Source

fn bg_opa(self, opa: u8) -> Self

Set the background opacity of the widget’s main part (0 = transparent, 255 = opaque).

Source

fn border_color(self, c: Color) -> Self

Set the border color of the widget’s main part.

Source

fn border_width(self, w: i32) -> Self

Set the border width in pixels.

Source

fn radius(self, r: i32) -> Self

Set the corner radius in pixels (use LV_RADIUS_CIRCLE for a pill shape).

Source

fn pad_all(self, p: i32) -> Self

Set equal padding on all four sides.

Source

fn pad_hor(self, p: i32) -> Self

Set equal left and right (horizontal) padding.

Source

fn pad_ver(self, p: i32) -> Self

Set equal top and bottom (vertical) padding.

Source

fn pad_gap(self, g: i32) -> Self

Set the row and column gap between flex children.

Source

fn text_color(self, c: Color) -> Self

Set the text color for label-like widgets.

Source

fn text_font(self, f: *const lv_font_t) -> Self

Set the text font. Use font_montserrat_32 or font_montserrat_14 for built-ins.

Source

fn add_style(self, style: &mut Style, selector: u32) -> Self

Apply a reusable Style to the given style selector (part + state bitmask).

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.

Implementors§

Source§

impl<T: Widget> Styleable for T