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_opa (lv_opa_t opa)
 Sets the background opacity.
 
Derived & border_color (lv_color_t c)
 Sets the border color.
 
Derived & border_width (int32_t w)
 Sets the border width in pixels.
 
Derived & radius (int32_t r)
 Sets the corner radius.
 
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.
 

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: