mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-21 14:32:44 +08:00
minor renames and fixes
This commit is contained in:
@@ -59,7 +59,6 @@ static void delete_children(lv_obj_t * obj);
|
||||
static void base_dir_refr_children(lv_obj_t * obj);
|
||||
static void obj_state_anim_cb(void * p, lv_anim_value_t value);
|
||||
static void lv_event_mark_deleted(lv_obj_t * obj);
|
||||
static void align_core(const lv_obj_t * base, const lv_obj_t * to_align, lv_align_t align, lv_point_t * res);
|
||||
static void lv_obj_del_async_cb(void * obj);
|
||||
static lv_design_res_t lv_obj_design(lv_obj_t * obj, const lv_area_t * clip_area, lv_design_mode_t mode);
|
||||
static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param);
|
||||
@@ -95,7 +94,6 @@ void lv_init(void)
|
||||
/*Initialize the lv_misc modules*/
|
||||
lv_mem_init();
|
||||
lv_task_core_init();
|
||||
lv_style_built_in_init();
|
||||
|
||||
#if LV_USE_FILESYSTEM
|
||||
lv_fs_init();
|
||||
@@ -109,8 +107,6 @@ void lv_init(void)
|
||||
lv_group_init();
|
||||
#endif
|
||||
|
||||
/*Init. the sstyles*/
|
||||
// lv_style_built_in_init();
|
||||
|
||||
lv_theme_t * th = lv_theme_default_init(0, NULL);
|
||||
lv_theme_set_act(th);
|
||||
|
||||
+45
-9
@@ -55,16 +55,20 @@ static lv_style_t * get_local_style(lv_style_list_t * list);
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
void lv_style_built_in_init(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize a style
|
||||
* @param style pointer to a style to initialize
|
||||
*/
|
||||
void lv_style_init(lv_style_t * style)
|
||||
{
|
||||
style->map = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a style with all its properties
|
||||
* @param style_dest pointer to the destination style. (Should be initialized with `lv_style_init()`)
|
||||
* @param style_src pointer to the source (to copy )style
|
||||
*/
|
||||
void lv_style_copy(lv_style_t * style_dest, const lv_style_t * style_src)
|
||||
{
|
||||
lv_style_init(style_dest);
|
||||
@@ -77,6 +81,10 @@ void lv_style_copy(lv_style_t * style_dest, const lv_style_t * style_src)
|
||||
memcpy(style_dest->map, style_src->map, size);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize a style list
|
||||
* @param list a style list to initialize
|
||||
*/
|
||||
void lv_style_list_init(lv_style_list_t * list)
|
||||
{
|
||||
list->style_list = NULL;
|
||||
@@ -84,6 +92,11 @@ void lv_style_list_init(lv_style_list_t * list)
|
||||
list->has_local = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a style list with all its styles and local style properties
|
||||
* @param list_dest pointer to the destination style list. (should be initialized with `lv_style_list_init()`)
|
||||
* @param list_src pointer to the source (to copy) style list.
|
||||
*/
|
||||
void lv_style_list_copy(lv_style_list_t * list_dest, const lv_style_list_t * list_src)
|
||||
{
|
||||
lv_style_list_reset(list_dest);
|
||||
@@ -101,11 +114,17 @@ void lv_style_list_copy(lv_style_list_t * list_dest, const lv_style_list_t * lis
|
||||
list_dest->style_cnt = list_src->style_cnt - 1;
|
||||
|
||||
lv_style_t * local_style = get_local_style(list_dest);
|
||||
lv_style_copy(local_style, get_local_style(list_src));
|
||||
lv_style_copy(local_style, (lv_style_t *)get_local_style(list_src));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add a style to a style list.
|
||||
* Only the the style pointer will be saved so the shouldn't be a local variable.
|
||||
* (It should be static, global or dynamically allocated)
|
||||
* @param list pointer to a style list
|
||||
* @param style pointer to a style to add
|
||||
*/
|
||||
void lv_style_list_add_style(lv_style_list_t * list, lv_style_t * style)
|
||||
{
|
||||
if(list == NULL) return;
|
||||
@@ -134,6 +153,11 @@ void lv_style_list_add_style(lv_style_list_t * list, lv_style_t * style)
|
||||
list->style_list = new_classes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a style from a style list
|
||||
* @param style_list pointer to a style list
|
||||
* @param style pointer to a style to remove
|
||||
*/
|
||||
void lv_style_list_remove_style(lv_style_list_t * list, lv_style_t * style)
|
||||
{
|
||||
if(list->style_cnt == 0) return;
|
||||
@@ -175,6 +199,10 @@ void lv_style_list_remove_style(lv_style_list_t * list, lv_style_t * style)
|
||||
list->style_list = new_classes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all styles added from style list, clear the local style and free all allocated memories
|
||||
* @param list pointer to a style list.
|
||||
*/
|
||||
void lv_style_list_reset(lv_style_list_t * list)
|
||||
{
|
||||
if(list == NULL) return;
|
||||
@@ -189,14 +217,22 @@ void lv_style_list_reset(lv_style_list_t * list)
|
||||
list->has_local = 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear all properties from a style and all allocated memories.
|
||||
* @param style pointer to a style
|
||||
*/
|
||||
void lv_style_reset(lv_style_t * style)
|
||||
{
|
||||
lv_mem_free(style->map);
|
||||
style->map = NULL;
|
||||
}
|
||||
|
||||
uint16_t lv_style_get_mem_size(lv_style_t * style)
|
||||
/**
|
||||
* Get the size of the properties in a style in bytes
|
||||
* @param style pointer to a style
|
||||
* @return size of the properties in bytes
|
||||
*/
|
||||
uint16_t lv_style_get_mem_size(const lv_style_t * style)
|
||||
{
|
||||
if(style->map == NULL) return 0;
|
||||
|
||||
|
||||
+51
-11
@@ -190,33 +190,73 @@ typedef struct {
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Init. the built-in styles
|
||||
* Initialize a style
|
||||
* @param style pointer to a style to initialize
|
||||
*/
|
||||
void lv_style_built_in_init(void);
|
||||
|
||||
void lv_style_init(lv_style_t * style);
|
||||
|
||||
void lv_style_list_init(lv_style_list_t * style_dsc);
|
||||
/**
|
||||
* Copy a style with all its properties
|
||||
* @param style_dest pointer to the destination style. (Should be initialized with `lv_style_init()`)
|
||||
* @param style_src pointer to the source (to copy )style
|
||||
*/
|
||||
void lv_style_copy(lv_style_t * style_dest, const lv_style_t * style_src);
|
||||
|
||||
/**
|
||||
* Initialize a style list
|
||||
* @param list a style list to initialize
|
||||
*/
|
||||
void lv_style_list_init(lv_style_list_t * list);
|
||||
|
||||
/**
|
||||
* Copy a style list with all its styles and local style properties
|
||||
* @param list_dest pointer to the destination style list. (should be initialized with `lv_style_list_init()`)
|
||||
* @param list_src pointer to the source (to copy) style list.
|
||||
*/
|
||||
void lv_style_list_copy(lv_style_list_t * list_dest, const lv_style_list_t * list_src);
|
||||
|
||||
void lv_style_list_add_style(lv_style_list_t * style_dsc, lv_style_t * style);
|
||||
/**
|
||||
* Add a style to a style list.
|
||||
* Only the the style pointer will be saved so the shouldn't be a local variable.
|
||||
* (It should be static, global or dynamically allocated)
|
||||
* @param list pointer to a style list
|
||||
* @param style pointer to a style to add
|
||||
*/
|
||||
void lv_style_list_add_style(lv_style_list_t * list, lv_style_t * style);
|
||||
|
||||
void lv_style_list_remove_style(lv_style_list_t * style_dsc, lv_style_t * class);
|
||||
/**
|
||||
* Remove a style from a style list
|
||||
* @param style_list pointer to a style list
|
||||
* @param style pointer to a style to remove
|
||||
*/
|
||||
void lv_style_list_remove_style(lv_style_list_t * list, lv_style_t * class);
|
||||
|
||||
void lv_style_list_reset(lv_style_list_t * style_dsc);
|
||||
/**
|
||||
* Remove all styles added from style list, clear the local style and free all allocated memories
|
||||
* @param list pointer to a style list.
|
||||
*/
|
||||
void lv_style_list_reset(lv_style_list_t * style_list);
|
||||
|
||||
static inline lv_style_t * lv_style_list_get_style(lv_style_list_t * style_dsc, uint8_t id)
|
||||
static inline lv_style_t * lv_style_list_get_style(lv_style_list_t * list, uint8_t id)
|
||||
{
|
||||
if(style_dsc->style_cnt == 0 || id >= style_dsc->style_cnt) return NULL;
|
||||
if(list->style_cnt == 0 || id >= list->style_cnt) return NULL;
|
||||
|
||||
return style_dsc->style_list[id];
|
||||
return list->style_list[id];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all properties from a style and all allocated memories.
|
||||
* @param style pointer to a style
|
||||
*/
|
||||
void lv_style_reset(lv_style_t * style);
|
||||
|
||||
uint16_t lv_style_get_mem_size(lv_style_t * style);
|
||||
/**
|
||||
* Get the size of the properties in a style in bytes
|
||||
* @param style pointer to a style
|
||||
* @return size of the properties in bytes
|
||||
*/
|
||||
uint16_t lv_style_get_mem_size(const lv_style_t * style);
|
||||
|
||||
/**
|
||||
* Copy a style to an other
|
||||
|
||||
@@ -107,7 +107,7 @@ lv_obj_t * lv_btnmatrix_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
if(copy == NULL) {
|
||||
lv_btnmatrix_set_map(btnm, lv_btnmatrix_def_map);
|
||||
lv_obj_set_size(btnm, LV_DPI * 3, LV_DPI * 2);
|
||||
lv_theme_apply(btnm, LV_THEME_BTNM);
|
||||
lv_theme_apply(btnm, LV_THEME_BTNMATRIX);
|
||||
}
|
||||
/*Copy an existing object*/
|
||||
else {
|
||||
@@ -849,9 +849,9 @@ static lv_res_t lv_btnmatrix_signal(lv_obj_t * btnm, lv_signal_t sign, void * pa
|
||||
if(button_is_tgl_enabled(ext->ctrl_bits[ext->btn_id_pr]) &&
|
||||
!button_is_inactive(ext->ctrl_bits[ext->btn_id_pr])) {
|
||||
if(button_get_tgl_state(ext->ctrl_bits[ext->btn_id_pr])) {
|
||||
ext->ctrl_bits[ext->btn_id_pr] &= (~LV_BTNMATRIX_CTRL_CHECHK_STATE);
|
||||
ext->ctrl_bits[ext->btn_id_pr] &= (~LV_BTNMATRIX_CTRL_CHECK_STATE);
|
||||
} else {
|
||||
ext->ctrl_bits[ext->btn_id_pr] |= LV_BTNMATRIX_CTRL_CHECHK_STATE;
|
||||
ext->ctrl_bits[ext->btn_id_pr] |= LV_BTNMATRIX_CTRL_CHECK_STATE;
|
||||
}
|
||||
if(ext->one_toggle) make_one_button_toggled(btnm, ext->btn_id_pr);
|
||||
}
|
||||
@@ -1094,7 +1094,7 @@ static bool button_is_tgl_enabled(lv_btnmatrix_ctrl_t ctrl_bits)
|
||||
|
||||
static bool button_get_tgl_state(lv_btnmatrix_ctrl_t ctrl_bits)
|
||||
{
|
||||
return ctrl_bits & LV_BTNMATRIX_CTRL_CHECHK_STATE ? true : false;
|
||||
return ctrl_bits & LV_BTNMATRIX_CTRL_CHECK_STATE ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1175,11 +1175,11 @@ static bool maps_are_identical(const char ** map1, const char ** map2)
|
||||
static void make_one_button_toggled(lv_obj_t * btnm, uint16_t btn_idx)
|
||||
{
|
||||
/*Save whether the button was toggled*/
|
||||
bool was_toggled = lv_btnmatrix_get_btn_ctrl(btnm, btn_idx, LV_BTNMATRIX_CTRL_CHECHK_STATE);
|
||||
bool was_toggled = lv_btnmatrix_get_btn_ctrl(btnm, btn_idx, LV_BTNMATRIX_CTRL_CHECK_STATE);
|
||||
|
||||
lv_btnmatrix_clear_btn_ctrl_all(btnm, LV_BTNMATRIX_CTRL_CHECHK_STATE);
|
||||
lv_btnmatrix_clear_btn_ctrl_all(btnm, LV_BTNMATRIX_CTRL_CHECK_STATE);
|
||||
|
||||
if(was_toggled) lv_btnmatrix_set_btn_ctrl(btnm, btn_idx, LV_BTNMATRIX_CTRL_CHECHK_STATE);
|
||||
if(was_toggled) lv_btnmatrix_set_btn_ctrl(btnm, btn_idx, LV_BTNMATRIX_CTRL_CHECK_STATE);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -40,7 +40,7 @@ enum {
|
||||
LV_BTNMATRIX_CTRL_NO_REPEAT = 0x0010, /**< Do not repeat press this button. */
|
||||
LV_BTNMATRIX_CTRL_INACTIVE = 0x0020, /**< Disable this button. */
|
||||
LV_BTNMATRIX_CTRL_CHECKABLE = 0x0040, /**< Button *can* be toggled. */
|
||||
LV_BTNMATRIX_CTRL_CHECHK_STATE = 0x0080, /**< Button is currently toggled (e.g. checked). */
|
||||
LV_BTNMATRIX_CTRL_CHECK_STATE = 0x0080, /**< Button is currently toggled (e.g. checked). */
|
||||
LV_BTNMATRIX_CTRL_CLICK_TRIG = 0x0100, /**< 1: Send LV_EVENT_SELECTED on CLICK, 0: Send LV_EVENT_SELECTED on PRESS*/
|
||||
};
|
||||
typedef uint16_t lv_btnmatrix_ctrl_t;
|
||||
|
||||
@@ -668,6 +668,8 @@ static void draw_header(lv_obj_t * calendar, const lv_area_t * mask)
|
||||
lv_obj_init_draw_rect_dsc(calendar, LV_CALENDAR_PART_HEADER, &header_rect_dsc);
|
||||
lv_draw_rect(&header_area, mask, &header_rect_dsc);
|
||||
|
||||
lv_obj_state_dsc_t state_ori = calendar->state_dsc;
|
||||
|
||||
/*Add the year + month name*/
|
||||
char txt_buf[64];
|
||||
lv_utils_num_to_str(ext->showed_date.year, txt_buf);
|
||||
@@ -675,15 +677,18 @@ static void draw_header(lv_obj_t * calendar, const lv_area_t * mask)
|
||||
txt_buf[5] = '\0';
|
||||
strcpy(&txt_buf[5], get_month_name(calendar, ext->showed_date.month));
|
||||
|
||||
calendar->state_dsc.act = LV_STATE_NORMAL;
|
||||
calendar->state_dsc.prev = LV_STATE_NORMAL;
|
||||
|
||||
lv_draw_label_dsc_t label_dsc;
|
||||
lv_draw_label_dsc_init(&label_dsc);
|
||||
lv_obj_init_draw_label_dsc(calendar, LV_CALENDAR_PART_HEADER, &label_dsc);
|
||||
label_dsc.flag = LV_TXT_FLAG_CENTER;
|
||||
lv_draw_label(&header_area, mask, &label_dsc,txt_buf, NULL);
|
||||
|
||||
/*Add the left arrow*/
|
||||
lv_obj_state_dsc_t state_ori = calendar->state_dsc;
|
||||
calendar->state_dsc = state_ori; /*Restore the state*/
|
||||
|
||||
/*Add the left arrow*/
|
||||
if(ext->btn_pressing < 0) calendar->state_dsc.act |= LV_STATE_PRESSED;
|
||||
else calendar->state_dsc.act &= ~(LV_STATE_PRESSED);
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ lv_obj_t * lv_checkbox_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
lv_btn_set_checkable(cb, true);
|
||||
lv_obj_set_protect(cb, LV_PROTECT_PRESS_LOST);
|
||||
|
||||
lv_theme_apply(cb, LV_THEME_CB);
|
||||
lv_theme_apply(cb, LV_THEME_CHECKBOX);
|
||||
|
||||
} else {
|
||||
lv_checkbox_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
|
||||
|
||||
@@ -128,7 +128,7 @@ lv_obj_t * lv_dropdown_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
if(copy == NULL) {
|
||||
lv_dropdown_set_options(ddlist, "Option 1\nOption 2\nOption 3");
|
||||
|
||||
lv_theme_apply(ddlist, LV_THEME_DDLIST);
|
||||
lv_theme_apply(ddlist, LV_THEME_DROPDOWN);
|
||||
}
|
||||
/*Copy an existing drop down list*/
|
||||
else {
|
||||
@@ -625,8 +625,8 @@ static lv_design_res_t lv_dropdown_design(lv_obj_t * ddlist, const lv_area_t * c
|
||||
txt_area.x1 = ddlist->coords.x1 + (lv_obj_get_width(ddlist) - txt_size.x) / 2;
|
||||
txt_area.x2 = txt_area.x1 + txt_size.x;
|
||||
} else {
|
||||
txt_area.x1 = txt_area.x2 - txt_size.x;
|
||||
txt_area.x2 = ddlist->coords.x2 - right;
|
||||
txt_area.x1 = ddlist->coords.x2 - right - txt_size.x;
|
||||
txt_area.x2 = txt_area.x1 + txt_size.x;
|
||||
}
|
||||
|
||||
lv_draw_label(&txt_area, clip_area, &label_dsc, txt, NULL);
|
||||
|
||||
@@ -146,11 +146,12 @@ lv_obj_t * lv_keyboard_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
lv_obj_align(kb, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
|
||||
lv_obj_set_event_cb(kb, lv_keyboard_def_event_cb);
|
||||
lv_obj_set_base_dir(kb, LV_BIDI_DIR_LTR);
|
||||
lv_obj_set_protect(kb, LV_PROTECT_CLICK_FOCUS);
|
||||
|
||||
lv_btnmatrix_set_map(kb, kb_map[ext->mode]);
|
||||
lv_btnmatrix_set_ctrl_map(kb, kb_ctrl[ext->mode]);
|
||||
|
||||
lv_theme_apply(kb, LV_THEME_KB);
|
||||
lv_theme_apply(kb, LV_THEME_KEYBOARD);
|
||||
|
||||
}
|
||||
/*Copy an existing keyboard*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file lv_rect.c
|
||||
* @file lv_label.c
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "../lv_misc/lv_math.h"
|
||||
#include "../lv_misc/lv_bidi.h"
|
||||
#include "../lv_misc/lv_printf.h"
|
||||
#include "../lv_themes/lv_theme.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -119,13 +120,13 @@ lv_obj_t * lv_label_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
ext->dot.tmp_ptr = NULL;
|
||||
ext->dot_tmp_alloc = 0;
|
||||
|
||||
lv_obj_reset_style(new_label, LV_LABEL_PART_MAIN);
|
||||
|
||||
lv_obj_set_design_cb(new_label, lv_label_design);
|
||||
lv_obj_set_signal_cb(new_label, lv_label_signal);
|
||||
|
||||
/*Init the new label*/
|
||||
if(copy == NULL) {
|
||||
lv_theme_apply(new_label, LV_THEME_LABEL);
|
||||
lv_obj_set_click(new_label, false);
|
||||
lv_label_set_long_mode(new_label, LV_LABEL_LONG_EXPAND);
|
||||
lv_label_set_text(new_label, "Text");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file lv_rect.h
|
||||
* @file lv_label.h
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ lv_obj_t * lv_linemeter_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
/*Init the new line meter line meter*/
|
||||
if(copy == NULL) {
|
||||
lv_obj_set_size(new_lmeter, LV_DPI, LV_DPI);
|
||||
lv_theme_apply(new_lmeter, LV_THEME_LMETER);
|
||||
lv_theme_apply(new_lmeter, LV_THEME_LINEMETER);
|
||||
}
|
||||
/*Copy an existing line meter*/
|
||||
else {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*********************/
|
||||
#define LV_OBJX_NAME "lv_list"
|
||||
|
||||
#define LV_LIST_LAYOUT_DEF LV_LAYOUT_COL_M
|
||||
#define LV_LIST_LAYOUT_DEF LV_LAYOUT_COLUMN_MID
|
||||
|
||||
#if LV_USE_ANIMATION == 0
|
||||
#undef LV_LIST_DEF_ANIM_TIME
|
||||
|
||||
@@ -107,7 +107,7 @@ lv_obj_t * lv_msgbox_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
lv_obj_set_event_cb(mbox, lv_msgbox_default_event_cb);
|
||||
|
||||
/*Set the default styles*/
|
||||
lv_theme_apply(mbox, LV_THEME_MBOX);
|
||||
lv_theme_apply(mbox, LV_THEME_MSGBOX);
|
||||
|
||||
}
|
||||
/*Copy an existing message box*/
|
||||
@@ -149,7 +149,7 @@ void lv_msgbox_add_btns(lv_obj_t * mbox, const char * btn_map[])
|
||||
if(ext->btnm == NULL) {
|
||||
ext->btnm = lv_btnmatrix_create(mbox, NULL);
|
||||
|
||||
lv_theme_alien_apply(mbox, LV_THEME_MBOX_BTNS);
|
||||
lv_theme_alien_apply(mbox, LV_THEME_MSGBOX_BTNS);
|
||||
}
|
||||
|
||||
lv_btnmatrix_set_map(ext->btnm, btn_map);
|
||||
|
||||
@@ -98,7 +98,7 @@ lv_obj_t * lv_spinner_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
ext->arc.bg_angle_start = 0;
|
||||
ext->arc.bg_angle_end = 360;
|
||||
lv_obj_set_size(preload, LV_DPI, LV_DPI);
|
||||
lv_theme_apply(preload, LV_THEME_PRELOAD);
|
||||
lv_theme_apply(preload, LV_THEME_SPINNER);
|
||||
|
||||
}
|
||||
/*Copy an existing spinner*/
|
||||
|
||||
@@ -92,7 +92,7 @@ lv_obj_t * lv_switch_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
lv_obj_set_size(sw, LV_DPI / 2, LV_DPI / 4);
|
||||
lv_bar_set_range(sw, 0, 1);
|
||||
|
||||
lv_theme_apply(sw, LV_THEME_SW);
|
||||
lv_theme_apply(sw, LV_THEME_SWITCH);
|
||||
}
|
||||
/*Copy an existing switch*/
|
||||
else {
|
||||
|
||||
@@ -326,7 +326,7 @@ void lv_tabview_set_tab_act(lv_obj_t * tabview, uint16_t id, lv_anim_enable_t an
|
||||
|
||||
if(id >= ext->tab_cnt) id = ext->tab_cnt - 1;
|
||||
|
||||
lv_btnmatrix_clear_btn_ctrl(ext->btns, ext->tab_cur, LV_BTNMATRIX_CTRL_CHECHK_STATE);
|
||||
lv_btnmatrix_clear_btn_ctrl(ext->btns, ext->tab_cur, LV_BTNMATRIX_CTRL_CHECK_STATE);
|
||||
|
||||
ext->tab_cur = id;
|
||||
|
||||
@@ -445,7 +445,7 @@ void lv_tabview_set_tab_act(lv_obj_t * tabview, uint16_t id, lv_anim_enable_t an
|
||||
}
|
||||
#endif
|
||||
|
||||
lv_btnmatrix_set_btn_ctrl(ext->btns, ext->tab_cur, LV_BTNMATRIX_CTRL_CHECHK_STATE);
|
||||
lv_btnmatrix_set_btn_ctrl(ext->btns, ext->tab_cur, LV_BTNMATRIX_CTRL_CHECK_STATE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -769,8 +769,8 @@ static void tab_btnm_event_cb(lv_obj_t * tab_btnm, lv_event_t event)
|
||||
uint16_t btn_id = lv_btnmatrix_get_active_btn(tab_btnm);
|
||||
if(btn_id == LV_BTNMATRIX_BTN_NONE) return;
|
||||
|
||||
lv_btnmatrix_clear_btn_ctrl_all(tab_btnm, LV_BTNMATRIX_CTRL_CHECHK_STATE);
|
||||
lv_btnmatrix_set_btn_ctrl(tab_btnm, btn_id, LV_BTNMATRIX_CTRL_CHECHK_STATE);
|
||||
lv_btnmatrix_clear_btn_ctrl_all(tab_btnm, LV_BTNMATRIX_CTRL_CHECK_STATE);
|
||||
lv_btnmatrix_set_btn_ctrl(tab_btnm, btn_id, LV_BTNMATRIX_CTRL_CHECK_STATE);
|
||||
|
||||
lv_obj_t * tabview = lv_obj_get_parent(tab_btnm);
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ lv_obj_t * lv_textarea_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
lv_obj_set_size(ta, LV_TEXTAREA_DEF_WIDTH, LV_TEXTAREA_DEF_HEIGHT);
|
||||
lv_textarea_set_sb_mode(ta, LV_SB_MODE_DRAG);
|
||||
|
||||
lv_theme_apply(ta, LV_THEME_TA);
|
||||
lv_theme_apply(ta, LV_THEME_TEXTAREA);
|
||||
|
||||
}
|
||||
/*Copy an existing object*/
|
||||
@@ -158,7 +158,6 @@ lv_obj_t * lv_textarea_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
ext->pwd_mode = copy_ext->pwd_mode;
|
||||
ext->accapted_chars = copy_ext->accapted_chars;
|
||||
ext->max_length = copy_ext->max_length;
|
||||
ext->cursor.style = copy_ext->cursor.style;
|
||||
ext->cursor.pos = copy_ext->cursor.pos;
|
||||
ext->cursor.valid_x = copy_ext->cursor.valid_x;
|
||||
|
||||
@@ -555,6 +554,8 @@ void lv_textarea_set_placeholder_text(lv_obj_t * ta, const char * txt)
|
||||
} else {
|
||||
lv_label_set_long_mode(ext->placeholder, LV_LABEL_LONG_BREAK);
|
||||
}
|
||||
|
||||
lv_theme_apply(ta, LV_THEME_TEXTAREA);
|
||||
}
|
||||
|
||||
lv_label_set_text(ext->placeholder, txt);
|
||||
|
||||
+31
-62
@@ -37,75 +37,44 @@ typedef enum {
|
||||
LV_THEME_NONE = 0,
|
||||
LV_THEME_SCR,
|
||||
LV_THEME_OBJ,
|
||||
|
||||
LV_THEME_CONT,
|
||||
|
||||
LV_THEME_ARC,
|
||||
LV_THEME_BAR,
|
||||
LV_THEME_BTN,
|
||||
|
||||
LV_THEME_LABEL,
|
||||
LV_THEME_LINE,
|
||||
|
||||
LV_THEME_BTNMATRIX,
|
||||
LV_THEME_CALENDAR,
|
||||
LV_THEME_CANVAS,
|
||||
LV_THEME_CHECKBOX,
|
||||
LV_THEME_CHART,
|
||||
LV_THEME_CONT,
|
||||
LV_THEME_CPICKER,
|
||||
LV_THEME_DROPDOWN,
|
||||
LV_THEME_GAUGE,
|
||||
LV_THEME_IMAGE,
|
||||
LV_THEME_IMGBTN,
|
||||
|
||||
LV_THEME_BTNM,
|
||||
|
||||
LV_THEME_KB,
|
||||
|
||||
LV_THEME_BAR,
|
||||
|
||||
LV_THEME_SLIDER,
|
||||
|
||||
LV_THEME_SW,
|
||||
|
||||
LV_THEME_CB,
|
||||
LV_THEME_CB_BULLET,
|
||||
|
||||
LV_THEME_PAGE,
|
||||
|
||||
LV_THEME_DDLIST,
|
||||
LV_THEME_DDLIST_PAGE,
|
||||
|
||||
LV_THEME_ROLLER,
|
||||
|
||||
LV_THEME_OBJMASK,
|
||||
|
||||
LV_THEME_TABVIEW,
|
||||
LV_THEME_TABVIEW_PAGE,
|
||||
|
||||
LV_THEME_TILEVIEW,
|
||||
|
||||
LV_THEME_LMETER,
|
||||
|
||||
LV_THEME_GAUGE,
|
||||
|
||||
LV_THEME_TA,
|
||||
LV_THEME_TA_ONELINE,
|
||||
|
||||
|
||||
LV_THEME_KEYBOARD,
|
||||
LV_THEME_LABEL,
|
||||
LV_THEME_LED,
|
||||
LV_THEME_LINE,
|
||||
LV_THEME_LIST,
|
||||
LV_THEME_LIST_BTN,
|
||||
|
||||
LV_THEME_CANVAS,
|
||||
LV_THEME_CPICKER,
|
||||
|
||||
LV_THEME_CALENDAR,
|
||||
|
||||
LV_THEME_ARC,
|
||||
LV_THEME_PRELOAD,
|
||||
|
||||
LV_THEME_LED,
|
||||
|
||||
LV_THEME_MBOX,
|
||||
LV_THEME_MBOX_BTNS,
|
||||
|
||||
LV_THEME_LINEMETER,
|
||||
LV_THEME_MSGBOX,
|
||||
LV_THEME_MSGBOX_BTNS, /*The button matrix of the buttons are initialized separately*/
|
||||
LV_THEME_OBJMASK,
|
||||
LV_THEME_PAGE,
|
||||
LV_THEME_ROLLER,
|
||||
LV_THEME_SLIDER,
|
||||
LV_THEME_SPINBOX,
|
||||
LV_THEME_SPINNER,
|
||||
LV_THEME_SWITCH,
|
||||
LV_THEME_TABLE,
|
||||
|
||||
LV_THEME_CHART,
|
||||
|
||||
LV_THEME_TABVIEW,
|
||||
LV_THEME_TABVIEW_PAGE, /*The tab pages are initialized separately*/
|
||||
LV_THEME_TEXTAREA,
|
||||
LV_THEME_TEXTAREA_ONELINE,
|
||||
LV_THEME_TILEVIEW,
|
||||
LV_THEME_WIN,
|
||||
LV_THEME_WIN_BTN,
|
||||
|
||||
LV_THEME_WIN_BTN, /*The buttons are initialized separately*/
|
||||
}lv_theme_style_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -93,7 +93,7 @@ static lv_style_t ddlist_btn, ddlist_page, ddlist_sel;
|
||||
#endif
|
||||
|
||||
#if LV_USE_TEXTAREA
|
||||
static lv_style_t ta_cursor, ta_oneline, ta_placeholder;
|
||||
static lv_style_t ta_bg, ta_cursor, ta_oneline, ta_placeholder;
|
||||
#endif
|
||||
|
||||
#if LV_USE_LED
|
||||
@@ -146,6 +146,9 @@ static void basic_init(void)
|
||||
lv_style_set_bg_color(&scr, LV_STATE_NORMAL, COLOR_SCREEN);
|
||||
lv_style_set_text_color(&scr, LV_STATE_NORMAL, lv_color_hex(0xb8b8b9));
|
||||
lv_style_set_value_color(&scr, LV_STATE_NORMAL, lv_color_hex(0xb8b8b9));
|
||||
lv_style_set_border_width(&scr, LV_STATE_NORMAL, 1);
|
||||
lv_style_set_border_color(&scr, LV_STATE_NORMAL, lv_color_hex3(0x444));
|
||||
lv_style_set_border_post(&scr, LV_STATE_NORMAL, true);
|
||||
|
||||
lv_style_init(&panel);
|
||||
lv_style_set_radius(&panel, LV_STATE_NORMAL, LV_DPI / 25);
|
||||
@@ -166,7 +169,7 @@ static void basic_init(void)
|
||||
lv_style_set_line_color(&panel, LV_STATE_NORMAL, lv_color_hex(0x979a9f));
|
||||
lv_style_set_line_width(&panel, LV_STATE_NORMAL, 1);
|
||||
lv_style_set_border_color(&panel, LV_STATE_FOCUSED, COLOR_ACCENT);
|
||||
lv_style_set_transition_time(&panel, LV_STATE_NORMAL, 500);
|
||||
lv_style_set_transition_time(&panel, LV_STATE_NORMAL, 300);
|
||||
|
||||
lv_style_init(&btn);
|
||||
lv_style_set_radius(&btn, LV_STATE_NORMAL, LV_RADIUS_CIRCLE);
|
||||
@@ -293,19 +296,22 @@ static void lmeter_init(void)
|
||||
{
|
||||
#if LV_USE_LMETER != 0
|
||||
lv_style_init(&lmeter);
|
||||
lv_style_copy(&lmeter, &panel);
|
||||
lv_style_set_radius(&lmeter, LV_STATE_NORMAL, LV_RADIUS_CIRCLE);
|
||||
lv_style_set_border_side(&lmeter, LV_STATE_NORMAL, LV_BORDER_SIDE_FULL);
|
||||
lv_style_set_bg_opa(&lmeter, LV_STATE_NORMAL, LV_OPA_COVER);
|
||||
lv_style_set_pad_left(&lmeter, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_right(&lmeter, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_top(&lmeter, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_inner(&lmeter, LV_STATE_NORMAL, LV_DPI / 6);
|
||||
lv_style_set_scale_width(&lmeter, LV_STATE_NORMAL, LV_DPI/12);
|
||||
|
||||
lv_style_set_scale_color(&lmeter, LV_STATE_NORMAL, LV_COLOR_AQUA);
|
||||
lv_style_set_scale_grad_color(&lmeter, LV_STATE_NORMAL, LV_COLOR_NAVY);
|
||||
lv_style_set_scale_end_color(&lmeter, LV_STATE_NORMAL, LV_COLOR_GRAY);
|
||||
lv_style_set_line_rounded(&lmeter, LV_STATE_NORMAL, true);
|
||||
lv_style_set_line_width(&lmeter, LV_STATE_NORMAL, 4);
|
||||
lv_style_set_scale_end_line_width(&lmeter, LV_STATE_NORMAL, 2);
|
||||
|
||||
/*Padding to not clip rounded line endings*/
|
||||
lv_style_set_pad_left(&lmeter, LV_STATE_NORMAL, 3);
|
||||
lv_style_set_pad_right(&lmeter, LV_STATE_NORMAL, 3);
|
||||
lv_style_set_pad_top(&lmeter, LV_STATE_NORMAL, 3);
|
||||
lv_style_set_pad_bottom(&lmeter, LV_STATE_NORMAL, 3);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -409,6 +415,7 @@ static void calendar_init(void)
|
||||
lv_style_set_text_color(&calendar_header, LV_STATE_PRESSED, LV_COLOR_WHITE);
|
||||
|
||||
lv_style_init(&calendar_daynames);
|
||||
lv_style_set_text_color(&calendar_daynames, LV_STATE_NORMAL, lv_color_hex3(0xeee));
|
||||
lv_style_set_pad_left(&calendar_daynames, LV_STATE_NORMAL , LV_DPI / 7);
|
||||
lv_style_set_pad_right(&calendar_daynames, LV_STATE_NORMAL , LV_DPI / 7);
|
||||
lv_style_set_pad_bottom(&calendar_daynames, LV_STATE_NORMAL , LV_DPI / 7);
|
||||
@@ -532,6 +539,20 @@ static void kb_init(void)
|
||||
static void mbox_init(void)
|
||||
{
|
||||
#if LV_USE_MSGBOX
|
||||
lv_style_init(&mbox_btn);
|
||||
lv_style_set_radius(&mbox_btn, LV_STATE_NORMAL, LV_RADIUS_CIRCLE);
|
||||
lv_style_set_bg_opa(&mbox_btn, LV_STATE_NORMAL, LV_OPA_COVER);
|
||||
lv_style_set_bg_color(&mbox_btn, LV_STATE_NORMAL, lv_color_lighten(COLOR_CONTAINER, LV_OPA_10));
|
||||
lv_style_set_bg_color(&mbox_btn, LV_STATE_PRESSED, lv_color_darken(COLOR_CONTAINER, LV_OPA_30));
|
||||
lv_style_set_bg_color(&mbox_btn, LV_STATE_CHECKED, COLOR_ACCENT);
|
||||
lv_style_set_bg_color(&mbox_btn, LV_STATE_CHECKED | LV_STATE_PRESSED, lv_color_darken(COLOR_ACCENT, LV_OPA_30));
|
||||
lv_style_set_border_width(&mbox_btn, LV_STATE_NORMAL, 2);
|
||||
lv_style_set_border_width(&mbox_btn, LV_STATE_CHECKED, 0);
|
||||
lv_style_set_text_color(&mbox_btn, LV_STATE_CHECKED, LV_COLOR_WHITE);
|
||||
lv_style_set_border_color(&mbox_btn, LV_STATE_NORMAL, lv_color_lighten(COLOR_CONTAINER, LV_OPA_30));
|
||||
lv_style_set_pad_top(&mbox_btn, LV_STATE_NORMAL, LV_DPI / 20);
|
||||
lv_style_set_pad_bottom(&mbox_btn, LV_STATE_NORMAL, LV_DPI / 20);
|
||||
|
||||
lv_style_init(&mbox_btn_bg);
|
||||
lv_style_set_pad_right(&mbox_btn_bg, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_bottom(&mbox_btn_bg, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
@@ -556,6 +577,14 @@ static void page_init(void)
|
||||
static void ta_init(void)
|
||||
{
|
||||
#if LV_USE_TEXTAREA
|
||||
lv_style_init(&ta_bg);
|
||||
lv_style_copy(&ta_bg, &panel);
|
||||
lv_style_set_border_side(&ta_bg, LV_STATE_NORMAL, LV_BORDER_SIDE_FULL);
|
||||
lv_style_set_pad_left(&ta_bg, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_right(&ta_bg, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_top(&ta_bg, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_bottom(&ta_bg, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
|
||||
lv_style_init(&ta_cursor);
|
||||
lv_style_set_border_color(&ta_cursor, LV_STATE_NORMAL, lv_color_hex(0x6c737b));
|
||||
lv_style_set_border_width(&ta_cursor, LV_STATE_NORMAL, 2);
|
||||
@@ -566,11 +595,13 @@ static void ta_init(void)
|
||||
lv_style_set_border_width(&ta_oneline, LV_STATE_NORMAL, 1);
|
||||
lv_style_set_radius(&ta_oneline, LV_STATE_NORMAL, LV_RADIUS_CIRCLE);
|
||||
lv_style_set_border_color(&ta_oneline, LV_STATE_NORMAL, lv_color_hex(0x3b3e43));
|
||||
lv_style_set_border_color(&ta_oneline, LV_STATE_FOCUSED, COLOR_ACCENT);
|
||||
lv_style_set_text_color(&ta_oneline, LV_STATE_NORMAL, lv_color_hex(0x6c737b));
|
||||
lv_style_set_pad_left(&ta_oneline, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_right(&ta_oneline, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_top(&ta_oneline, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_bottom(&ta_oneline, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_transition_time(&ta_oneline, LV_STATE_NORMAL, 300);
|
||||
|
||||
lv_style_init(&ta_placeholder);
|
||||
lv_style_set_text_color(&ta_placeholder, LV_STATE_NORMAL, lv_color_hex(0x3b3e43));
|
||||
@@ -588,35 +619,45 @@ static void list_init(void)
|
||||
#if LV_USE_LIST != 0
|
||||
lv_style_init(&list_bg);
|
||||
lv_style_copy(&list_bg, &panel);
|
||||
lv_style_set_pad_left(&list_bg, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_right(&list_bg, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_left(&list_bg, LV_STATE_NORMAL, 0);
|
||||
lv_style_set_pad_right(&list_bg, LV_STATE_NORMAL, 0);
|
||||
lv_style_set_pad_top(&list_bg, LV_STATE_NORMAL, 0);
|
||||
lv_style_set_pad_bottom(&list_bg, LV_STATE_NORMAL, 0);
|
||||
lv_style_set_pad_inner(&list_bg, LV_STATE_NORMAL, 0);
|
||||
|
||||
lv_style_init(&list_btn);
|
||||
lv_style_set_bg_opa(&list_btn, LV_STATE_PRESSED, LV_OPA_20);
|
||||
lv_style_set_radius(&list_btn, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_radius(&list_btn, LV_STATE_PRESSED, 0);
|
||||
lv_style_set_radius(&list_btn, LV_STATE_CHECKED, 0);
|
||||
lv_style_set_bg_opa(&list_btn, LV_STATE_PRESSED, LV_OPA_COVER);
|
||||
lv_style_set_bg_opa(&list_btn, LV_STATE_CHECKED , LV_OPA_COVER);
|
||||
lv_style_set_bg_opa(&list_btn, LV_STATE_NORMAL, LV_OPA_TRANSP);
|
||||
lv_style_set_bg_color(&list_btn, LV_STATE_PRESSED, LV_COLOR_WHITE);
|
||||
lv_style_set_bg_color(&list_btn, LV_STATE_NORMAL, COLOR_CONTAINER);
|
||||
lv_style_set_bg_color(&list_btn, LV_STATE_PRESSED, lv_color_hex3(0x444));
|
||||
lv_style_set_bg_color(&list_btn, LV_STATE_DISABLED, COLOR_DISABLED);
|
||||
lv_style_set_bg_color(&list_btn, LV_STATE_CHECKED, COLOR_ACCENT);
|
||||
lv_style_set_bg_color(&list_btn, LV_STATE_CHECKED | LV_STATE_PRESSED, lv_color_darken(COLOR_ACCENT, LV_OPA_30));
|
||||
lv_style_set_text_color(&list_btn, LV_STATE_NORMAL, lv_color_hex(0xffffff));
|
||||
lv_style_set_text_color(&list_btn, LV_STATE_PRESSED, lv_color_darken(lv_color_hex(0xffffff), LV_OPA_20));
|
||||
lv_style_set_text_color(&list_btn, LV_STATE_DISABLED, lv_color_hex(0x686b70));
|
||||
lv_style_set_text_color(&list_btn, LV_STATE_FOCUSED, lv_color_hex(0xff0000));
|
||||
lv_style_set_text_color(&list_btn, LV_STATE_FOCUSED| LV_STATE_PRESSED, lv_color_hex(0xffff00));
|
||||
lv_style_set_image_recolor(&list_btn, LV_STATE_NORMAL, LV_COLOR_WHITE);
|
||||
lv_style_set_image_recolor(&list_btn, LV_STATE_PRESSED, lv_color_darken(lv_color_hex(0xffffff), LV_OPA_20));
|
||||
lv_style_set_image_recolor(&list_btn, LV_STATE_DISABLED, lv_color_hex(0x686b70));
|
||||
|
||||
|
||||
lv_style_set_border_opa(&list_btn, LV_STATE_NORMAL, LV_OPA_COVER);
|
||||
lv_style_set_border_width(&list_btn, LV_STATE_NORMAL, 1);
|
||||
lv_style_set_border_side(&list_btn, LV_STATE_NORMAL, LV_BORDER_SIDE_BOTTOM);
|
||||
lv_style_set_border_color(&list_btn, LV_STATE_NORMAL, lv_color_hex(0x979a9f));
|
||||
lv_style_set_border_color(&list_btn, LV_STATE_FOCUSED, COLOR_ACCENT);
|
||||
lv_style_set_border_color(&list_btn, LV_STATE_FOCUSED | LV_STATE_CHECKED, lv_color_hex(0x979a9f));
|
||||
|
||||
lv_style_set_pad_left(&list_btn, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_right(&list_btn, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_top(&list_btn, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_bottom(&list_btn, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_pad_inner(&list_btn, LV_STATE_NORMAL, LV_DPI / 10);
|
||||
lv_style_set_transition_time(&list_btn, LV_STATE_NORMAL, 500);
|
||||
lv_style_set_transition_time(&list_btn, LV_STATE_NORMAL, 300);
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -635,7 +676,7 @@ static void ddlist_init(void)
|
||||
lv_style_init(&ddlist_page);
|
||||
lv_style_copy(&ddlist_page, &panel);
|
||||
lv_style_set_border_side(&ddlist_page, LV_STATE_NORMAL, LV_BORDER_SIDE_FULL);
|
||||
lv_style_set_bg_color(&ddlist_page, LV_STATE_NORMAL, lv_color_hex3(0xeee));
|
||||
lv_style_set_bg_color(&ddlist_page, LV_STATE_NORMAL, lv_color_hex(0xf0f0f0));
|
||||
lv_style_set_text_color(&ddlist_page, LV_STATE_NORMAL, lv_color_hex3(0x333));
|
||||
lv_style_set_text_line_space(&ddlist_page, LV_STATE_NORMAL, LV_DPI / 5);
|
||||
lv_style_set_border_post(&ddlist_page, LV_STATE_NORMAL, true);
|
||||
@@ -797,6 +838,9 @@ void lv_theme_alien_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
lv_style_list_t * list;
|
||||
|
||||
switch(name) {
|
||||
case LV_THEME_NONE:
|
||||
break;
|
||||
|
||||
case LV_THEME_SCR:
|
||||
list = lv_obj_get_style_list(obj, LV_OBJ_PART_MAIN);
|
||||
lv_style_list_reset(list);
|
||||
@@ -824,7 +868,7 @@ void lv_theme_alien_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
#endif
|
||||
|
||||
#if LV_USE_BTNMATRIX
|
||||
case LV_THEME_BTNM:
|
||||
case LV_THEME_BTNMATRIX:
|
||||
list = lv_obj_get_style_list(obj, LV_BTNMATRIX_PART_BG);
|
||||
lv_style_list_reset(list);
|
||||
lv_style_list_add_style(list, &btnm_bg);
|
||||
@@ -836,7 +880,7 @@ void lv_theme_alien_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
#endif
|
||||
|
||||
#if LV_USE_KEYBOARD
|
||||
case LV_THEME_KB:
|
||||
case LV_THEME_KEYBOARD:
|
||||
list = lv_obj_get_style_list(obj, LV_KEYBOARD_PART_BG);
|
||||
lv_style_list_reset(list);
|
||||
lv_style_list_add_style(list, &kb_bg);
|
||||
@@ -860,7 +904,7 @@ void lv_theme_alien_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
#endif
|
||||
|
||||
#if LV_USE_SWITCH
|
||||
case LV_THEME_SW:
|
||||
case LV_THEME_SWITCH:
|
||||
list = lv_obj_get_style_list(obj, LV_SWITCH_PART_BG);
|
||||
lv_style_list_reset(list);
|
||||
lv_style_list_add_style(list, &bar_bg);
|
||||
@@ -923,7 +967,7 @@ void lv_theme_alien_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
#endif
|
||||
|
||||
#if LV_USE_SPINNER
|
||||
case LV_THEME_PRELOAD:
|
||||
case LV_THEME_SPINNER:
|
||||
list = lv_obj_get_style_list(obj, LV_SPINNER_PART_BG);
|
||||
lv_style_list_reset(list);
|
||||
lv_style_list_add_style(list, &arc_bg);
|
||||
@@ -951,7 +995,7 @@ void lv_theme_alien_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
#endif
|
||||
|
||||
#if LV_USE_CHECKBOX
|
||||
case LV_THEME_CB:
|
||||
case LV_THEME_CHECKBOX:
|
||||
list = lv_obj_get_style_list(obj, LV_CHECKBOX_PART_BG);
|
||||
lv_style_list_reset(list);
|
||||
lv_style_list_add_style(list, &cb_bg);
|
||||
@@ -963,20 +1007,20 @@ void lv_theme_alien_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
#endif
|
||||
|
||||
#if LV_USE_MSGBOX
|
||||
case LV_THEME_MBOX:
|
||||
case LV_THEME_MSGBOX:
|
||||
list = lv_obj_get_style_list(obj, LV_MSGBOX_PART_BG);
|
||||
lv_style_list_reset(list);
|
||||
lv_style_list_add_style(list, &panel);
|
||||
break;
|
||||
|
||||
case LV_THEME_MBOX_BTNS:
|
||||
case LV_THEME_MSGBOX_BTNS:
|
||||
list = lv_obj_get_style_list(obj, LV_MSGBOX_PART_BTN_BG);
|
||||
lv_style_list_reset(list);
|
||||
lv_style_list_add_style(list, &mbox_btn_bg);
|
||||
|
||||
list = lv_obj_get_style_list(obj, LV_MSGBOX_PART_BTN);
|
||||
lv_style_list_reset(list);
|
||||
lv_style_list_add_style(list, &btnm_btn);
|
||||
lv_style_list_add_style(list, &mbox_btn);
|
||||
break;
|
||||
|
||||
#endif
|
||||
@@ -1094,7 +1138,7 @@ void lv_theme_alien_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
#endif
|
||||
|
||||
#if LV_USE_DROPDOWN
|
||||
case LV_THEME_DDLIST:
|
||||
case LV_THEME_DROPDOWN:
|
||||
list = lv_obj_get_style_list(obj, LV_DROPDOWN_PART_BTN);
|
||||
lv_style_list_reset(list);
|
||||
lv_style_list_add_style(list, &ddlist_btn);
|
||||
@@ -1177,10 +1221,10 @@ void lv_theme_alien_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
#endif
|
||||
|
||||
#if LV_USE_TEXTAREA
|
||||
case LV_THEME_TA:
|
||||
case LV_THEME_TEXTAREA:
|
||||
list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_BG);
|
||||
lv_style_list_reset(list);
|
||||
lv_style_list_add_style(list, &panel);
|
||||
lv_style_list_add_style(list, &ta_bg);
|
||||
|
||||
list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_PLACEHOLDER);
|
||||
lv_style_list_reset(list);
|
||||
@@ -1195,7 +1239,7 @@ void lv_theme_alien_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
lv_style_list_add_style(list, &sb);
|
||||
break;
|
||||
|
||||
case LV_THEME_TA_ONELINE:
|
||||
case LV_THEME_TEXTAREA_ONELINE:
|
||||
list = lv_obj_get_style_list(obj, LV_TEXTAREA_PART_BG);
|
||||
lv_style_list_reset(list);
|
||||
lv_style_list_add_style(list, &ta_oneline);
|
||||
@@ -1246,7 +1290,7 @@ void lv_theme_alien_apply(lv_obj_t * obj, lv_theme_style_t name)
|
||||
#endif
|
||||
|
||||
#if LV_USE_LMETER
|
||||
case LV_THEME_LMETER:
|
||||
case LV_THEME_LINEMETER:
|
||||
list = lv_obj_get_style_list(obj, LV_LINEMETER_PART_MAIN);
|
||||
lv_style_list_reset(list);
|
||||
lv_style_list_add_style(list, &lmeter);
|
||||
|
||||
Reference in New Issue
Block a user