oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ove::lvgl::StyleMixin< Derived > Class Template Reference

CRTP mixin that adds inline per-object style setters to widget classes. More...

#include <lvgl.hpp>

Public Member Functions

Derived & bg_color (lv_color_t c)
 Sets the background color of the object.
 
Derived & bg_color (lv_color_t c, lv_style_selector_t part)
 Sets the background color of a specific part (e.g. LV_PART_INDICATOR, LV_PART_KNOB, LV_PART_SCROLLBAR).
 
Derived & bg_opa (lv_opa_t opa)
 Sets the background opacity.
 
Derived & bg_opa (lv_opa_t opa, lv_style_selector_t part)
 Sets the background opacity on a specific part.
 
Derived & border_color (lv_color_t c)
 Sets the border color.
 
Derived & border_width (int32_t w)
 Sets the border width in pixels.
 
Derived & border_width (int32_t w, lv_style_selector_t part)
 Sets the border width on a specific part.
 
Derived & radius (int32_t r)
 Sets the corner radius.
 
Derived & radius (int32_t r, lv_style_selector_t part)
 Sets the corner radius on a specific part.
 
Derived & pad_all (int32_t p)
 Sets uniform padding on all four sides.
 
Derived & pad_hor (int32_t p)
 Sets horizontal (left + right) padding.
 
Derived & pad_ver (int32_t p)
 Sets vertical (top + bottom) padding.
 
Derived & pad_gap (int32_t g)
 Sets the gap between children in flex/grid layouts.
 
Derived & text_color (lv_color_t c)
 Sets the text color.
 
Derived & text_font (const lv_font_t *f)
 Sets the font used to render text.
 
Derived & pad_top (int32_t p)
 Sets top padding in pixels.
 
Derived & pad_bottom (int32_t p)
 Sets bottom padding in pixels.
 
Derived & pad_left (int32_t p)
 Sets left padding in pixels.
 
Derived & pad_right (int32_t p)
 Sets right padding in pixels.
 
Derived & pad_row (int32_t p)
 Sets the row gap between children in flex/grid layouts.
 
Derived & pad_column (int32_t p)
 Sets the column gap between children in flex/grid layouts.
 
Derived & text_align (uint32_t align, lv_style_selector_t part=LV_PART_MAIN)
 Sets the horizontal text alignment on the given part.
 
Derived & set_opa (lv_opa_t opa)
 Sets the overall object opacity (0–255, or LV_OPA_*).
 
Derived & text_color (lv_color_t c, lv_style_selector_t part)
 Sets text color on a specific part.
 
Derived & border_color (lv_color_t c, lv_style_selector_t part)
 Sets border color on a specific part.
 
Derived & arc_color (lv_color_t c, lv_style_selector_t part)
 Sets arc color on a specific part.
 
Derived & arc_width (int32_t w, lv_style_selector_t part)
 Sets arc stroke width on a specific part.
 
Derived & arc_opa (lv_opa_t opa, lv_style_selector_t part)
 Sets arc opacity on a specific part.
 
Derived & arc_rounded (bool rounded, lv_style_selector_t part)
 Enables/disables rounded arc end caps on a specific part.
 
Derived & translate_y (int32_t v, lv_style_selector_t part=LV_PART_MAIN)
 Sets a vertical translation (post-layout offset) on the given part.
 
Derived & margin_top (int32_t v, lv_style_selector_t part=LV_PART_MAIN)
 Sets top margin (outer spacing) on the given part.
 
Derived & margin_bottom (int32_t v, lv_style_selector_t part=LV_PART_MAIN)
 Sets bottom margin (outer spacing) on the given part.
 
Derived & margin_left (int32_t v, lv_style_selector_t part=LV_PART_MAIN)
 Sets left margin (outer spacing) on the given part.
 
Derived & margin_right (int32_t v, lv_style_selector_t part=LV_PART_MAIN)
 Sets right margin (outer spacing) on the given part.
 
Derived & max_height (int32_t v, lv_style_selector_t part=LV_PART_MAIN)
 Sets the maximum height (in pixels) on the given part.
 
Derived & opa_layered (lv_opa_t opa, lv_style_selector_t part=LV_PART_MAIN)
 Sets the layered opacity (applied after compositing) on the given part.
 

Detailed Description

template<typename Derived>
class ove::lvgl::StyleMixin< Derived >

CRTP mixin that adds inline per-object style setters to widget classes.

Each method applies a single style property directly to the LV_PART_MAIN part of the underlying LVGL object and returns Derived & to support method chaining. These are convenience wrappers around the LVGL lv_obj_set_style_* family of functions.

Template Parameters
DerivedThe concrete widget class inheriting this mixin. Must expose a get() method returning lv_obj_t*.

Member Function Documentation

◆ bg_color()

template<typename Derived >
Derived & ove::lvgl::StyleMixin< Derived >::bg_color ( lv_color_t  c)
inline

Sets the background color of the object.

Parameters
[in]cBackground color.
Returns
Reference to the derived object for method chaining.

◆ bg_opa()

template<typename Derived >
Derived & ove::lvgl::StyleMixin< Derived >::bg_opa ( lv_opa_t  opa)
inline

Sets the background opacity.

Parameters
[in]opaOpacity value (0–255, or LV_OPA_* constants).
Returns
Reference to the derived object for method chaining.

◆ border_color()

template<typename Derived >
Derived & ove::lvgl::StyleMixin< Derived >::border_color ( lv_color_t  c)
inline

Sets the border color.

Parameters
[in]cBorder color.
Returns
Reference to the derived object for method chaining.

◆ border_width()

template<typename Derived >
Derived & ove::lvgl::StyleMixin< Derived >::border_width ( int32_t  w)
inline

Sets the border width in pixels.

Parameters
[in]wBorder width.
Returns
Reference to the derived object for method chaining.

◆ radius()

template<typename Derived >
Derived & ove::lvgl::StyleMixin< Derived >::radius ( int32_t  r)
inline

Sets the corner radius.

Parameters
[in]rRadius in pixels; use LV_RADIUS_CIRCLE for a full circle.
Returns
Reference to the derived object for method chaining.

◆ pad_all()

template<typename Derived >
Derived & ove::lvgl::StyleMixin< Derived >::pad_all ( int32_t  p)
inline

Sets uniform padding on all four sides.

Parameters
[in]pPadding in pixels.
Returns
Reference to the derived object for method chaining.

◆ pad_hor()

template<typename Derived >
Derived & ove::lvgl::StyleMixin< Derived >::pad_hor ( int32_t  p)
inline

Sets horizontal (left + right) padding.

Parameters
[in]pPadding in pixels.
Returns
Reference to the derived object for method chaining.

◆ pad_ver()

template<typename Derived >
Derived & ove::lvgl::StyleMixin< Derived >::pad_ver ( int32_t  p)
inline

Sets vertical (top + bottom) padding.

Parameters
[in]pPadding in pixels.
Returns
Reference to the derived object for method chaining.

◆ pad_gap()

template<typename Derived >
Derived & ove::lvgl::StyleMixin< Derived >::pad_gap ( int32_t  g)
inline

Sets the gap between children in flex/grid layouts.

Parameters
[in]gGap in pixels.
Returns
Reference to the derived object for method chaining.

◆ text_color()

template<typename Derived >
Derived & ove::lvgl::StyleMixin< Derived >::text_color ( lv_color_t  c)
inline

Sets the text color.

Parameters
[in]cText color.
Returns
Reference to the derived object for method chaining.

◆ text_font()

template<typename Derived >
Derived & ove::lvgl::StyleMixin< Derived >::text_font ( const lv_font_t *  f)
inline

Sets the font used to render text.

Parameters
[in]fPointer to an LVGL font descriptor.
Returns
Reference to the derived object for method chaining.

The documentation for this class was generated from the following file: