lv_theme.h
Typedefs
-
typedef void (*lv_theme_apply_cb_t)(struct _lv_theme_t*, lv_obj_t*)
-
typedef struct _lv_theme_t lv_theme_t
Functions
-
lv_theme_t *lv_theme_get_from_obj(lv_obj_t *obj)
Get the theme assigned to the display of the object
- Parameters:
obj -- pointer to a theme object
- Returns:
the theme of the object's display (can be NULL)
-
void lv_theme_apply(lv_obj_t *obj)
Apply the active theme on an object
- Parameters:
obj -- pointer to an object
-
void lv_theme_set_parent(lv_theme_t *new_theme, lv_theme_t *parent)
Set a base theme for a theme. The styles from the base them will be added before the styles of the current theme. Arbitrary long chain of themes can be created by setting base themes.
- Parameters:
new_theme -- pointer to theme which base should be set
parent -- pointer to the base theme
-
void lv_theme_set_apply_cb(lv_theme_t *theme, lv_theme_apply_cb_t apply_cb)
Set an apply callback for a theme. The apply callback is used to add styles to different objects
- Parameters:
theme -- pointer to theme which callback should be set
apply_cb -- pointer to the callback
-
const lv_font_t *lv_theme_get_font_small(lv_obj_t *obj)
Get the small font of the theme
- Parameters:
obj -- pointer to an object
- Returns:
pointer to the font
-
const lv_font_t *lv_theme_get_font_normal(lv_obj_t *obj)
Get the normal font of the theme
- Parameters:
obj -- pointer to an object
- Returns:
pointer to the font
-
const lv_font_t *lv_theme_get_font_large(lv_obj_t *obj)
Get the subtitle font of the theme
- Parameters:
obj -- pointer to an object
- Returns:
pointer to the font
-
lv_color_t lv_theme_get_color_primary(lv_obj_t *obj)
Get the primary color of the theme
- Parameters:
obj -- pointer to an object
- Returns:
the color
-
lv_color_t lv_theme_get_color_secondary(lv_obj_t *obj)
Get the secondary color of the theme
- Parameters:
obj -- pointer to an object
- Returns:
the color
-
struct _lv_theme_t
Public Members
-
lv_theme_apply_cb_t apply_cb
-
struct _lv_theme_t *parent
Apply the current theme's style on top of this theme.
-
void *user_data
-
struct _lv_display_t *disp
-
lv_color_t color_primary
-
lv_color_t color_secondary
-
uint32_t flags
-
lv_theme_apply_cb_t apply_cb