pub struct Tabview { /* private fields */ }Expand description
LVGL tabview — tabbed container with swipeable pages.
Implementations§
Source§impl Tabview
impl Tabview
Sourcepub fn add_tab(self, name: &[u8]) -> Obj
pub fn add_tab(self, name: &[u8]) -> Obj
Add a new tab and return its content container as an Obj.
Sourcepub fn rename_tab(self, idx: u32, name: &[u8]) -> Self
pub fn rename_tab(self, idx: u32, name: &[u8]) -> Self
Fluent: rename an existing tab by index.
Sourcepub fn set_active(self, idx: u32, anim: bool) -> Self
pub fn set_active(self, idx: u32, anim: bool) -> Self
Fluent: set the active tab index. anim = true to animate the switch.
Sourcepub fn tab_bar_position(self, dir: lv_dir_t) -> Self
pub fn tab_bar_position(self, dir: lv_dir_t) -> Self
Fluent: set the tab bar position. Use an LV_DIR_* value.
Sourcepub fn tab_bar_size(self, size: i32) -> Self
pub fn tab_bar_size(self, size: i32) -> Self
Fluent: set the tab bar size in pixels.
Sourcepub fn get_tab_count(self) -> u32
pub fn get_tab_count(self) -> u32
Returns the total number of tabs.
Sourcepub fn get_tab_active(self) -> u32
pub fn get_tab_active(self) -> u32
Returns the currently active tab index.
Sourcepub fn get_content(self) -> Obj
pub fn get_content(self) -> Obj
Returns the content container that houses all tabs’ content areas.
Trait Implementations§
impl Copy for Tabview
impl Send for Tabview
impl Sync for Tabview
Auto Trait Implementations§
impl Freeze for Tabview
impl RefUnwindSafe for Tabview
impl Unpin for Tabview
impl UnsafeUnpin for Tabview
impl UnwindSafe for Tabview
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EventTarget for Twhere
T: Widget,
impl<T> EventTarget for Twhere
T: Widget,
Source§fn on_fn(self, code: lv_event_code_t, handler: fn(EventCtx<'_>)) -> Self
fn on_fn(self, code: lv_event_code_t, handler: fn(EventCtx<'_>)) -> Self
Register a stateless safe handler for any LVGL event code.
Source§fn on_clicked(self, handler: fn(EventCtx<'_>)) -> Self
fn on_clicked(self, handler: fn(EventCtx<'_>)) -> Self
Register a stateless safe handler for click events.
Source§fn on_value_change(self, handler: fn(EventCtx<'_>)) -> Self
fn on_value_change(self, handler: fn(EventCtx<'_>)) -> Self
Register a stateless safe handler for value-changed events.
Source§fn on_with<T: Send + Sync + 'static>(
self,
code: lv_event_code_t,
handler: &'static EventHandler<T>,
) -> Self
fn on_with<T: Send + Sync + 'static>( self, code: lv_event_code_t, handler: &'static EventHandler<T>, ) -> Self
Register a stateful safe handler — the handler receives the shared
state from the bundled
InitCell and an EventCtx.Source§fn on_clicked_with<T: Send + Sync + 'static>(
self,
handler: &'static EventHandler<T>,
) -> Self
fn on_clicked_with<T: Send + Sync + 'static>( self, handler: &'static EventHandler<T>, ) -> Self
Stateful click handler (see
EventTarget::on_with).Source§fn on_value_change_with<T: Send + Sync + 'static>(
self,
handler: &'static EventHandler<T>,
) -> Self
fn on_value_change_with<T: Send + Sync + 'static>( self, handler: &'static EventHandler<T>, ) -> Self
Stateful value-change handler (see
EventTarget::on_with).Source§impl<T> Layout for Twhere
T: Widget,
impl<T> Layout for Twhere
T: Widget,
Source§fn 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.
Source§fn 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. Read more
Source§fn 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).Source§fn remove_flag(self, f: u32) -> Self
fn remove_flag(self, f: u32) -> Self
Remove one or more LVGL object flags.
Source§fn 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).Source§fn remove_state(self, s: u32) -> Self
fn remove_state(self, s: u32) -> Self
Remove one or more LVGL object state bits.
Source§fn grid_dsc(self, cols: &'static [i32], rows: &'static [i32]) -> Self
fn grid_dsc(self, cols: &'static [i32], rows: &'static [i32]) -> Self
Configure this widget as a grid container. Read more
Source§fn grid_cell(
self,
col_align: u32,
col_pos: i32,
col_span: i32,
row_align: u32,
row_pos: i32,
row_span: i32,
) -> Self
fn grid_cell( self, col_align: u32, col_pos: i32, col_span: i32, row_align: u32, row_pos: i32, row_span: i32, ) -> Self
Place this widget into a cell of its parent grid.
Source§fn flex_flow(self, flow: FlexFlow) -> Self
fn flex_flow(self, flow: FlexFlow) -> Self
Configure this widget as a flex container with the given main-axis flow.
Source§fn flex_align(self, main: FlexAlign, cross: FlexAlign, track: FlexAlign) -> Self
fn flex_align(self, main: FlexAlign, cross: FlexAlign, track: FlexAlign) -> Self
Set flex container alignment along the main, cross (per item), and
cross (per track) axes. Equivalent to
lv_obj_set_flex_align.Source§fn layout(self, kind: LayoutKind) -> Self
fn layout(self, kind: LayoutKind) -> Self
Switch the widget’s layout engine (None / Flex / Grid).
Source§fn scroll_to_y(self, y: i32, anim: bool) -> Self
fn scroll_to_y(self, y: i32, anim: bool) -> Self
Scroll the widget so the given Y coordinate is visible.
anim enables animation.Source§fn update_layout(self) -> Self
fn update_layout(self) -> Self
Force layout recomputation immediately (for queries that need live values).
Source§fn content_width(self) -> i32
fn content_width(self) -> i32
Width of the inner content area (excludes paddings/scrollbars).
Source§fn scroll_bottom(self) -> i32
fn scroll_bottom(self) -> i32
Distance the widget can still scroll towards its bottom edge.
Source§impl<T> Styleable for Twhere
T: Widget,
impl<T> Styleable for Twhere
T: Widget,
Source§fn 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).
Source§fn border_color(self, c: Color) -> Self
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
fn border_width(self, w: i32) -> Self
Set the border width in pixels.
Source§fn 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).Source§fn pad_bottom(self, p: i32) -> Self
fn pad_bottom(self, p: i32) -> Self
Set bottom padding.
Source§fn text_color(self, c: Color) -> Self
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
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 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).
Source§fn margin_top(self, v: i32, selector: u32) -> Self
fn margin_top(self, v: i32, selector: u32) -> Self
Top margin in pixels.
Source§fn margin_bottom(self, v: i32, selector: u32) -> Self
fn margin_bottom(self, v: i32, selector: u32) -> Self
Bottom margin in pixels.
Source§fn margin_left(self, v: i32, selector: u32) -> Self
fn margin_left(self, v: i32, selector: u32) -> Self
Left margin in pixels.
Source§fn margin_right(self, v: i32, selector: u32) -> Self
fn margin_right(self, v: i32, selector: u32) -> Self
Right margin in pixels.
Source§fn 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).Source§fn 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).
Source§fn arc_rounded(self, rounded: bool, selector: u32) -> Self
fn arc_rounded(self, rounded: bool, selector: u32) -> Self
Whether the arc has rounded ends.
Source§fn 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).
Source§fn 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.Source§fn 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).
Source§fn bg_opa_sel(self, opa: u8, selector: u32) -> Self
fn bg_opa_sel(self, opa: u8, selector: u32) -> Self
Background opacity with explicit selector.
Source§fn border_color_sel(self, c: Color, selector: u32) -> Self
fn border_color_sel(self, c: Color, selector: u32) -> Self
Border color with explicit selector.
Source§fn text_color_sel(self, c: Color, selector: u32) -> Self
fn text_color_sel(self, c: Color, selector: u32) -> Self
Text color with explicit selector.
Source§fn 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.
Source§fn pad_column(self, p: i32) -> Self
fn pad_column(self, p: i32) -> Self
Column gap (flex layout).