Skip to main content

Scale

Struct Scale 

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

LVGL scale widget — linear or radial scale with ticks and labels.

Implementations§

Source§

impl Scale

Source

pub fn create(parent: impl Widget) -> Self

Create a new scale as a child of parent.

Source

pub fn mode(self, mode: u32) -> Self

Fluent: set the layout mode (use SCALE_MODE_*).

Source

pub fn range(self, min: i32, max: i32) -> Self

Fluent: set the value range.

Source

pub fn total_tick_count(self, count: u32) -> Self

Fluent: total number of tick marks.

Source

pub fn major_tick_every(self, nth: u32) -> Self

Fluent: every Nth tick is a major tick.

Source

pub fn angle_range(self, angle: u32) -> Self

Fluent: angle range for round scales.

Source

pub fn rotation(self, rot: i32) -> Self

Fluent: rotation offset for round scales.

Source

pub fn add_section(self) -> ScaleSection

Add a coloured/styled section to the scale.

Trait Implementations§

Source§

impl Clone for Scale

Source§

fn clone(&self) -> Scale

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Deref for Scale

Source§

type Target = Obj

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Obj

Dereferences the value.
Source§

impl Widget for Scale

Source§

fn raw(self) -> *mut lv_obj_t

Return the raw lv_obj_t pointer for this widget. Read more
Source§

impl Copy for Scale

Source§

impl Send for Scale

Source§

impl Sync for Scale

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> EventTarget for T
where T: Widget,

Source§

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

Register a stateless safe handler for click events.
Source§

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

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

Stateful click handler (see EventTarget::on_with).
Source§

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> 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> Layout for T
where T: Widget,

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. Read more
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.
Source§

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

Place this widget into a cell of its parent grid.
Source§

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

Set flex container alignment along the main, cross (per item), and cross (per track) axes. Equivalent to lv_obj_set_flex_align.
Source§

fn flex_grow(self, grow: u8) -> Self

Set this child’s flex grow factor (0 disables growing).
Source§

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

Scroll the widget so the given Y coordinate is visible. anim enables animation.
Source§

fn update_layout(self) -> Self

Force layout recomputation immediately (for queries that need live values).
Source§

fn content_width(self) -> i32

Width of the inner content area (excludes paddings/scrollbars).
Source§

fn scroll_bottom(self) -> i32

Distance the widget can still scroll towards its bottom edge.
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Styleable for T
where T: Widget,

Source§

fn bg_color(self, c: Color) -> Self

Set the background color of the widget’s main part.
Source§

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

Set the border color of the widget’s main part.
Source§

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

Set the border width in pixels.
Source§

fn radius(self, r: i32) -> Self

Set the corner radius in pixels (use LV_RADIUS_CIRCLE for a pill shape).
Source§

fn pad_all(self, p: i32) -> Self

Set equal padding on all four sides.
Source§

fn pad_hor(self, p: i32) -> Self

Set equal left and right (horizontal) padding.
Source§

fn pad_ver(self, p: i32) -> Self

Set equal top and bottom (vertical) padding.
Source§

fn pad_top(self, p: i32) -> Self

Set top padding.
Source§

fn pad_bottom(self, p: i32) -> Self

Set bottom padding.
Source§

fn pad_left(self, p: i32) -> Self

Set left padding.
Source§

fn pad_right(self, p: i32) -> Self

Set right padding.
Source§

fn pad_gap(self, g: i32) -> Self

Set the row and column gap between flex children.
Source§

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

Set the text font. Use font_montserrat_32 or font_montserrat_14 for built-ins.
Source§

fn add_style(self, style: &Style, selector: u32) -> Self

Apply a reusable Style to the given style selector (part + state bitmask). Read more
Source§

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

Top margin in pixels.
Source§

fn margin_bottom(self, v: i32, selector: u32) -> Self

Bottom margin in pixels.
Source§

fn margin_left(self, v: i32, selector: u32) -> Self

Left margin in pixels.
Source§

fn margin_right(self, v: i32, selector: u32) -> Self

Right margin in pixels.
Source§

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

Arc opacity for arc-drawing widgets (0..=255).
Source§

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

Layered opacity (composites the whole subtree at the given alpha).
Source§

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

Background color with explicit selector (part + state bits).
Source§

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

Border color with explicit selector.
Source§

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

Arc track color with explicit selector.
Source§

fn arc_width(self, w: i32, selector: u32) -> Self

Arc track width with explicit selector.
Source§

fn pad_row(self, p: i32) -> Self

Row gap (flex layout).
Source§

fn pad_column(self, p: i32) -> Self

Column gap (flex layout).
Source§

fn set_opa(self, opa: u8) -> Self

Overall object opacity (0..=255).
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.