lv_theme.h

Typedefs

typedef void (*lv_theme_apply_cb_t)(lv_theme_t*, lv_obj_t*)

Functions

lv_theme_t *lv_theme_get_from_obj(lv_obj_t *obj)

Get the theme assigned to the display of the object

参数:

obj -- pointer to a theme object

返回:

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

参数:

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.

参数:
  • 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

参数:
  • 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

参数:

obj -- pointer to an object

返回:

pointer to the font

const lv_font_t *lv_theme_get_font_normal(lv_obj_t *obj)

Get the normal font of the theme

参数:

obj -- pointer to an object

返回:

pointer to the font

const lv_font_t *lv_theme_get_font_large(lv_obj_t *obj)

Get the subtitle font of the theme

参数:

obj -- pointer to an object

返回:

pointer to the font

lv_color_t lv_theme_get_color_primary(lv_obj_t *obj)

Get the primary color of the theme

参数:

obj -- pointer to an object

返回:

the color

lv_color_t lv_theme_get_color_secondary(lv_obj_t *obj)

Get the secondary color of the theme

参数:

obj -- pointer to an object

返回:

the color

struct _lv_theme_t

Public Members

lv_theme_apply_cb_t apply_cb
lv_theme_t *parent

Apply the current theme's style on top of this theme.

void *user_data
lv_display_t *disp
lv_color_t color_primary
lv_color_t color_secondary
const lv_font_t *font_small
const lv_font_t *font_normal
const lv_font_t *font_large
uint32_t flags