Skip to main content

Group

Struct Group 

Source
pub struct Group { /* private fields */ }
Expand description

RAII wrapper for an LVGL input focus group (lv_group_t).

Groups route keyboard/encoder/button events to a focused member widget. Essential for non-touch targets. Create a group, add widgets via Group::add, then wire it to an input device via the backend-specific indev registration (outside this crate).

Dropping the Group deletes the underlying lv_group_t.

Implementations§

Source§

impl Group

Source

pub fn new() -> Self

Create a fresh focus group.

Source

pub fn as_raw(&self) -> *mut lv_group_t

Raw lv_group_t * for FFI interop.

Source

pub fn set_as_default(&self) -> &Self

Fluent: mark this group as the default.

Source

pub fn add(&self, obj: impl Widget) -> &Self

Fluent: add a widget to the group’s focusable list.

Source

pub fn remove_all(&self) -> &Self

Fluent: remove all widgets from this group.

Source

pub fn focus_next(&self) -> &Self

Fluent: move focus to the next member.

Source

pub fn focus_prev(&self) -> &Self

Fluent: move focus to the previous member.

Source

pub fn focus_freeze(&self, freeze: bool) -> &Self

Fluent: freeze/unfreeze focus movement.

Source

pub fn focused(&self) -> Option<Obj>

Returns the currently focused widget as an Obj handle, or None if the group is empty.

Source

pub fn edit_mode(&self, enable: bool) -> &Self

Fluent: enable/disable encoder edit mode.

Source

pub fn is_editing(&self) -> bool

Returns the current edit-mode flag.

Source

pub fn obj_count(&self) -> u32

Returns the number of widgets in the group.

Source

pub fn focus_obj(obj: impl Widget)

Static helper: focus a widget regardless of its group.

Source

pub fn remove_obj(obj: impl Widget)

Static helper: remove a widget from whatever group it’s in.

Trait Implementations§

Source§

impl Default for Group

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for Group

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for Group

Source§

impl Sync for Group

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.