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§
Sourcefn bg_opa(self, opa: u8) -> Self
fn bg_opa(self, opa: u8) -> Self
Set the background opacity of the widget’s main part (0 = transparent, 255 = opaque).
Sourcefn border_color(self, c: Color) -> Self
fn border_color(self, c: Color) -> Self
Set the border color of the widget’s main part.
Sourcefn border_width(self, w: i32) -> Self
fn border_width(self, w: i32) -> Self
Set the border width in pixels.
Sourcefn radius(self, r: i32) -> Self
fn radius(self, r: i32) -> Self
Set the corner radius in pixels (use LV_RADIUS_CIRCLE for a pill shape).
Sourcefn text_color(self, c: Color) -> Self
fn text_color(self, c: Color) -> Self
Set the text color for label-like widgets.
Sourcefn text_font(self, f: *const lv_font_t) -> Self
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.
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.