Layout

Trait Layout 

Source
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§

Source

fn size(self, w: i32, h: i32) -> Self

Set both width and height of the widget in pixels.

Source

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

Set the width of the widget in pixels.

Source

fn height(self, h: i32) -> Self

Set the height of the widget in pixels.

Source

fn pos(self, x: i32, y: i32) -> Self

Set the position of the widget relative to its parent’s top-left corner.

Source

fn center(self) -> Self

Center the widget within its parent.

Source

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).

Source

fn hide(self) -> Self

Hide the widget by setting LV_OBJ_FLAG_HIDDEN.

Source

fn show(self) -> Self

Make the widget visible by removing LV_OBJ_FLAG_HIDDEN.

Source

fn visible(self, v: bool) -> Self

Show or hide the widget. Equivalent to calling show or hide.

Source

fn add_flag(self, f: u32) -> Self

Add one or more LVGL object flags (bitwise OR of LV_OBJ_FLAG_* values).

Source

fn remove_flag(self, f: u32) -> Self

Remove one or more LVGL object flags.

Source

fn add_state(self, s: u32) -> Self

Add one or more LVGL object state bits (e.g. LV_STATE_CHECKED).

Source

fn remove_state(self, s: u32) -> Self

Remove one or more LVGL object state bits.

Source

fn clickable(self, on: bool) -> Self

Enable or disable click events on the widget.

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> Layout for T