pub trait Layout: Widget + Sized {
Show 14 methods
// Provided methods
fn size(self, w: i32, h: i32) -> Self { ... }
fn width(self, w: i32) -> Self { ... }
fn height(self, h: i32) -> Self { ... }
fn pos(self, x: i32, y: i32) -> Self { ... }
fn center(self) -> Self { ... }
fn align(self, a: u8, x_ofs: i32, y_ofs: i32) -> Self { ... }
fn hide(self) -> Self { ... }
fn show(self) -> Self { ... }
fn visible(self, v: bool) -> Self { ... }
fn add_flag(self, f: u32) -> Self { ... }
fn remove_flag(self, f: u32) -> Self { ... }
fn add_state(self, s: u32) -> Self { ... }
fn remove_state(self, s: u32) -> Self { ... }
fn clickable(self, on: bool) -> Self { ... }
}Expand description
Fluent positioning, sizing, and flag manipulation.
Blanket-implemented for all Widget types.
Provided Methods§
Sourcefn pos(self, x: i32, y: i32) -> Self
fn pos(self, x: i32, y: i32) -> Self
Set the position of the widget relative to its parent’s top-left corner.
Sourcefn align(self, a: u8, x_ofs: i32, y_ofs: i32) -> Self
fn align(self, a: u8, x_ofs: i32, y_ofs: i32) -> Self
Align the widget using an LVGL alignment constant and pixel offsets.
a must be one of the ALIGN_* constants (e.g. ALIGN_CENTER).
Sourcefn add_flag(self, f: u32) -> Self
fn add_flag(self, f: u32) -> Self
Add one or more LVGL object flags (bitwise OR of LV_OBJ_FLAG_* values).
Sourcefn remove_flag(self, f: u32) -> Self
fn remove_flag(self, f: u32) -> Self
Remove one or more LVGL object flags.
Sourcefn add_state(self, s: u32) -> Self
fn add_state(self, s: u32) -> Self
Add one or more LVGL object state bits (e.g. LV_STATE_CHECKED).
Sourcefn remove_state(self, s: u32) -> Self
fn remove_state(self, s: u32) -> Self
Remove one or more LVGL object state bits.
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.