pub trait Styleable: Widget + Sized {
Show 35 methods
// 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_top(self, p: i32) -> Self { ... }
fn pad_bottom(self, p: i32) -> Self { ... }
fn pad_left(self, p: i32) -> Self { ... }
fn pad_right(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: &Style, selector: u32) -> Self { ... }
fn translate_y(self, v: i32, selector: u32) -> Self { ... }
fn margin_top(self, v: i32, selector: u32) -> Self { ... }
fn margin_bottom(self, v: i32, selector: u32) -> Self { ... }
fn margin_left(self, v: i32, selector: u32) -> Self { ... }
fn margin_right(self, v: i32, selector: u32) -> Self { ... }
fn max_height(self, v: i32, selector: u32) -> Self { ... }
fn arc_opa(self, opa: u8, selector: u32) -> Self { ... }
fn arc_rounded(self, rounded: bool, selector: u32) -> Self { ... }
fn opa_layered(self, opa: u8, selector: u32) -> Self { ... }
fn text_align(self, align: u32, selector: u32) -> Self { ... }
fn bg_color_sel(self, c: Color, selector: u32) -> Self { ... }
fn bg_opa_sel(self, opa: u8, selector: u32) -> Self { ... }
fn border_color_sel(self, c: Color, selector: u32) -> Self { ... }
fn text_color_sel(self, c: Color, selector: u32) -> Self { ... }
fn arc_color_sel(self, c: Color, selector: u32) -> Self { ... }
fn arc_width(self, w: i32, selector: u32) -> Self { ... }
fn pad_row(self, p: i32) -> Self { ... }
fn pad_column(self, p: i32) -> Self { ... }
fn set_opa(self, opa: u8) -> 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 pad_bottom(self, p: i32) -> Self
fn pad_bottom(self, p: i32) -> Self
Set bottom padding.
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.
Sourcefn add_style(self, style: &Style, selector: u32) -> Self
fn add_style(self, style: &Style, selector: u32) -> Self
Apply a reusable Style to the given style selector (part + state bitmask).
Takes &Style — LVGL reads the pointer but does not mutate the
style once added. style must outlive the widget (typical use:
store in a InitCell<Style> or &'static).
Sourcefn translate_y(self, v: i32, selector: u32) -> Self
fn translate_y(self, v: i32, selector: u32) -> Self
Apply a vertical translation (post-layout offset, in pixels).
Sourcefn margin_top(self, v: i32, selector: u32) -> Self
fn margin_top(self, v: i32, selector: u32) -> Self
Top margin in pixels.
Sourcefn margin_bottom(self, v: i32, selector: u32) -> Self
fn margin_bottom(self, v: i32, selector: u32) -> Self
Bottom margin in pixels.
Sourcefn margin_left(self, v: i32, selector: u32) -> Self
fn margin_left(self, v: i32, selector: u32) -> Self
Left margin in pixels.
Sourcefn margin_right(self, v: i32, selector: u32) -> Self
fn margin_right(self, v: i32, selector: u32) -> Self
Right margin in pixels.
Sourcefn max_height(self, v: i32, selector: u32) -> Self
fn max_height(self, v: i32, selector: u32) -> Self
Maximum height in pixels (caps set_height/content sizing).
Sourcefn arc_opa(self, opa: u8, selector: u32) -> Self
fn arc_opa(self, opa: u8, selector: u32) -> Self
Arc opacity for arc-drawing widgets (0..=255).
Sourcefn arc_rounded(self, rounded: bool, selector: u32) -> Self
fn arc_rounded(self, rounded: bool, selector: u32) -> Self
Whether the arc has rounded ends.
Sourcefn opa_layered(self, opa: u8, selector: u32) -> Self
fn opa_layered(self, opa: u8, selector: u32) -> Self
Layered opacity (composites the whole subtree at the given alpha).
Sourcefn text_align(self, align: u32, selector: u32) -> Self
fn text_align(self, align: u32, selector: u32) -> Self
Set the text alignment (TEXT_ALIGN_*) for the given selector.
Sourcefn bg_color_sel(self, c: Color, selector: u32) -> Self
fn bg_color_sel(self, c: Color, selector: u32) -> Self
Background color with explicit selector (part + state bits).
Sourcefn bg_opa_sel(self, opa: u8, selector: u32) -> Self
fn bg_opa_sel(self, opa: u8, selector: u32) -> Self
Background opacity with explicit selector.
Sourcefn border_color_sel(self, c: Color, selector: u32) -> Self
fn border_color_sel(self, c: Color, selector: u32) -> Self
Border color with explicit selector.
Sourcefn text_color_sel(self, c: Color, selector: u32) -> Self
fn text_color_sel(self, c: Color, selector: u32) -> Self
Text color with explicit selector.
Sourcefn arc_color_sel(self, c: Color, selector: u32) -> Self
fn arc_color_sel(self, c: Color, selector: u32) -> Self
Arc track color with explicit selector.
Sourcefn pad_column(self, p: i32) -> Self
fn pad_column(self, p: i32) -> Self
Column gap (flex layout).
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.