api(style) add lv_style_selector_t instead of lv_part_t and lv_state_t in style API
This commit is contained in:
@@ -226,7 +226,7 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t
|
||||
lv_disp_load_scr(d->scr_to_load);
|
||||
lv_anim_del(d->scr_to_load, NULL);
|
||||
lv_obj_set_pos(d->scr_to_load, 0, 0);
|
||||
lv_obj_remove_local_style_prop(d->scr_to_load, LV_PART_MAIN, LV_STATE_DEFAULT, LV_STYLE_OPA);
|
||||
lv_obj_remove_local_style_prop(d->scr_to_load, LV_STYLE_OPA, 0);
|
||||
|
||||
act_scr = d->scr_to_load;
|
||||
}
|
||||
@@ -247,8 +247,8 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t
|
||||
/*Be sure both screens are in a normal position*/
|
||||
lv_obj_set_pos(new_scr, 0, 0);
|
||||
lv_obj_set_pos(lv_scr_act(), 0, 0);
|
||||
lv_obj_remove_local_style_prop(new_scr, LV_PART_MAIN, LV_STATE_DEFAULT, LV_STYLE_OPA);
|
||||
lv_obj_remove_local_style_prop(lv_scr_act(), LV_PART_MAIN, LV_STATE_DEFAULT, LV_STYLE_OPA);
|
||||
lv_obj_remove_local_style_prop(new_scr, LV_STYLE_OPA, 0);
|
||||
lv_obj_remove_local_style_prop(lv_scr_act(), LV_STYLE_OPA, 0);
|
||||
|
||||
lv_anim_t a_new;
|
||||
lv_anim_init(&a_new);
|
||||
@@ -408,7 +408,7 @@ static void scr_load_anim_start(lv_anim_t * a)
|
||||
|
||||
static void opa_scale_anim(void * obj, int32_t v)
|
||||
{
|
||||
lv_obj_set_style_opa(obj, LV_PART_MAIN, LV_STATE_DEFAULT, v);
|
||||
lv_obj_set_style_opa(obj, v, 0);
|
||||
}
|
||||
|
||||
static void set_x_anim(void * obj, int32_t v)
|
||||
@@ -428,5 +428,5 @@ static void scr_anim_ready(lv_anim_t * a)
|
||||
if(d->prev_scr && d->del_prev) lv_obj_del(d->prev_scr);
|
||||
d->prev_scr = NULL;
|
||||
d->scr_to_load = NULL;
|
||||
lv_obj_remove_local_style_prop(a->var, LV_PART_MAIN, LV_STATE_DEFAULT, LV_STYLE_OPA);
|
||||
lv_obj_remove_local_style_prop(a->var, LV_STYLE_OPA, 0);
|
||||
}
|
||||
|
||||
@@ -51,8 +51,7 @@ typedef struct _lv_event_temp_data {
|
||||
typedef struct {
|
||||
uint16_t time;
|
||||
uint16_t delay;
|
||||
lv_part_t part;
|
||||
lv_state_t state;
|
||||
lv_style_selector_t selector;
|
||||
lv_style_prop_t prop;
|
||||
const lv_anim_path_t * path;
|
||||
}trans_set_t;
|
||||
@@ -990,7 +989,8 @@ static void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state)
|
||||
uint32_t i;
|
||||
for(i = 0; i < obj->style_cnt && tsi < STYLE_TRANSITION_MAX; i++) {
|
||||
lv_obj_style_t * obj_style = &obj->styles[i];
|
||||
if(obj_style->state & (~new_state)) continue; /*Skip unrelated styles*/
|
||||
lv_state_t state_act = lv_obj_style_get_selector_state(obj->styles[i].selector);
|
||||
if(state_act & (~new_state)) continue; /*Skip unrelated styles*/
|
||||
if(obj_style->is_trans) continue;
|
||||
|
||||
lv_style_value_t v;
|
||||
@@ -1002,7 +1002,8 @@ static void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state)
|
||||
for(j = 0; tr->props[j] != 0 && tsi < STYLE_TRANSITION_MAX; j++) {
|
||||
uint32_t t;
|
||||
for(t = 0; t < tsi; t++) {
|
||||
if(ts[t].prop == tr->props[j] && ts[t].state >= obj_style->state) break;
|
||||
lv_state_t state_tr = lv_obj_style_get_selector_state(ts[t].selector);
|
||||
if(ts[t].prop == tr->props[j] && state_tr >= state_act) break;
|
||||
}
|
||||
|
||||
/*If not found add it*/
|
||||
@@ -1011,15 +1012,15 @@ static void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state)
|
||||
ts[tsi].delay = tr->delay;
|
||||
ts[tsi].path = tr->path;
|
||||
ts[tsi].prop = tr->props[j];
|
||||
ts[tsi].part = obj_style->part;
|
||||
ts[tsi].state = obj_style->state;
|
||||
ts[tsi].selector = obj_style->selector;
|
||||
tsi++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(i = 0;i < tsi; i++) {
|
||||
_lv_obj_style_create_transition(obj, ts[i].prop, ts[i].part, prev_state, new_state, ts[i].time, ts[i].delay, ts[i].path);
|
||||
lv_part_t part_act = lv_obj_style_get_selector_part(ts[i].selector);
|
||||
_lv_obj_style_create_transition(obj, ts[i].prop, part_act, prev_state, new_state, ts[i].time, ts[i].delay, ts[i].path);
|
||||
}
|
||||
|
||||
lv_mem_buf_release(ts);
|
||||
|
||||
@@ -138,28 +138,21 @@ typedef uint16_t lv_state_t;
|
||||
* Note every part is used by every widget
|
||||
*/
|
||||
enum {
|
||||
LV_PART_MAIN, /**< A background like rectangle*/
|
||||
LV_PART_SCROLLBAR, /**< The scrollbar(s)*/
|
||||
LV_PART_INDICATOR, /**< Indicator, e.g. for slider, bar, switch, or the tick box of the checkbox*/
|
||||
LV_PART_KNOB, /**< Like handle to grab to adjust the value*/
|
||||
LV_PART_SELECTED, /**< Indicate the currently selected option or section*/
|
||||
LV_PART_ITEMS, /**< Used if the widget has multiple similar elements (e.g. tabel cells)*/
|
||||
LV_PART_TICKS, /**< Ticks on scale e.g. for a chart or meter*/
|
||||
LV_PART_CURSOR, /**< Mark a specific place e.g. for text area's cursor or on a chart*/
|
||||
LV_PART_MAIN = 0x000000, /**< A background like rectangle*/
|
||||
LV_PART_SCROLLBAR = 0x010000, /**< The scrollbar(s)*/
|
||||
LV_PART_INDICATOR = 0x020000, /**< Indicator, e.g. for slider, bar, switch, or the tick box of the checkbox*/
|
||||
LV_PART_KNOB = 0x030000, /**< Like handle to grab to adjust the value*/
|
||||
LV_PART_SELECTED = 0x040000, /**< Indicate the currently selected option or section*/
|
||||
LV_PART_ITEMS = 0x050000, /**< Used if the widget has multiple similar elements (e.g. tabel cells)*/
|
||||
LV_PART_TICKS = 0x060000, /**< Ticks on scale e.g. for a chart or meter*/
|
||||
LV_PART_CURSOR = 0x070000, /**< Mark a specific place e.g. for text area's cursor or on a chart*/
|
||||
|
||||
LV_PART_CUSTOM_1 = 0x40, /**< Extension point for custom widgets*/
|
||||
LV_PART_CUSTOM_2, /**< Extension point for custom widgets*/
|
||||
LV_PART_CUSTOM_3, /**< Extension point for custom widgets*/
|
||||
LV_PART_CUSTOM_4, /**< Extension point for custom widgets*/
|
||||
LV_PART_CUSTOM_5, /**< Extension point for custom widgets*/
|
||||
LV_PART_CUSTOM_6, /**< Extension point for custom widgets*/
|
||||
LV_PART_CUSTOM_7, /**< Extension point for custom widgets*/
|
||||
LV_PART_CUSTOM_8, /**< Extension point for custom widgets*/
|
||||
LV_PART_CUSTOM_FIRST = 0x800000, /**< Extension point for custom widgets*/
|
||||
|
||||
LV_PART_ANY = 0xFF, /**< Special value can be used in some functions to target all parts*/
|
||||
LV_PART_ANY = 0xFF0000, /**< Special value can be used in some functions to target all parts*/
|
||||
};
|
||||
|
||||
typedef uint16_t lv_part_t;
|
||||
typedef uint32_t lv_part_t;
|
||||
|
||||
/**
|
||||
* On/Off features controlling the object's behavior.
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t * draw_dsc)
|
||||
void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint32_t part, lv_draw_rect_dsc_t * draw_dsc)
|
||||
{
|
||||
|
||||
#if LV_DRAW_COMPLEX
|
||||
@@ -179,7 +179,7 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
||||
#endif
|
||||
}
|
||||
|
||||
void lv_obj_init_draw_label_dsc(lv_obj_t * obj, uint8_t part, lv_draw_label_dsc_t * draw_dsc)
|
||||
void lv_obj_init_draw_label_dsc(lv_obj_t * obj, uint32_t part, lv_draw_label_dsc_t * draw_dsc)
|
||||
{
|
||||
draw_dsc->opa = lv_obj_get_style_text_opa(obj, part);
|
||||
if(draw_dsc->opa <= LV_OPA_MIN) return;
|
||||
@@ -211,7 +211,7 @@ void lv_obj_init_draw_label_dsc(lv_obj_t * obj, uint8_t part, lv_draw_label_dsc_
|
||||
}
|
||||
}
|
||||
|
||||
void lv_obj_init_draw_img_dsc(lv_obj_t * obj, uint8_t part, lv_draw_img_dsc_t * draw_dsc)
|
||||
void lv_obj_init_draw_img_dsc(lv_obj_t * obj, uint32_t part, lv_draw_img_dsc_t * draw_dsc)
|
||||
{
|
||||
draw_dsc->opa = lv_obj_get_style_img_opa(obj, part);
|
||||
if(draw_dsc->opa <= LV_OPA_MIN) return;
|
||||
@@ -236,7 +236,7 @@ void lv_obj_init_draw_img_dsc(lv_obj_t * obj, uint8_t part, lv_draw_img_dsc_t *
|
||||
#endif
|
||||
}
|
||||
|
||||
void lv_obj_init_draw_line_dsc(lv_obj_t * obj, uint8_t part, lv_draw_line_dsc_t * draw_dsc)
|
||||
void lv_obj_init_draw_line_dsc(lv_obj_t * obj, uint32_t part, lv_draw_line_dsc_t * draw_dsc)
|
||||
{
|
||||
draw_dsc->width = lv_obj_get_style_line_width(obj, part);
|
||||
if(draw_dsc->width == 0) return;
|
||||
@@ -265,7 +265,7 @@ void lv_obj_init_draw_line_dsc(lv_obj_t * obj, uint8_t part, lv_draw_line_dsc_t
|
||||
#endif
|
||||
}
|
||||
|
||||
void lv_obj_init_draw_arc_dsc(lv_obj_t * obj, uint8_t part, lv_draw_arc_dsc_t * draw_dsc)
|
||||
void lv_obj_init_draw_arc_dsc(lv_obj_t * obj, uint32_t part, lv_draw_arc_dsc_t * draw_dsc)
|
||||
{
|
||||
draw_dsc->width = lv_obj_get_style_arc_width(obj, part);
|
||||
if(draw_dsc->width == 0) return;
|
||||
@@ -289,7 +289,7 @@ void lv_obj_init_draw_arc_dsc(lv_obj_t * obj, uint8_t part, lv_draw_arc_dsc_t *
|
||||
#endif
|
||||
}
|
||||
|
||||
lv_coord_t lv_obj_calculate_ext_draw_size(lv_obj_t * obj, uint8_t part)
|
||||
lv_coord_t lv_obj_calculate_ext_draw_size(lv_obj_t * obj, uint32_t part)
|
||||
{
|
||||
lv_coord_t s = 0;
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ typedef struct
|
||||
char text[16];
|
||||
int32_t value;
|
||||
uint32_t id;
|
||||
uint32_t part :8;
|
||||
uint32_t part;
|
||||
const void * sub_part_ptr;
|
||||
}lv_obj_draw_dsc_t;
|
||||
|
||||
@@ -67,7 +67,7 @@ typedef struct
|
||||
* @note Only the relevant fields will be set.
|
||||
* E.g. if `border width == 0` the other border properties won't be evaluated.
|
||||
*/
|
||||
void lv_obj_init_draw_rect_dsc(struct _lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t * draw_dsc);
|
||||
void lv_obj_init_draw_rect_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_rect_dsc_t * draw_dsc);
|
||||
|
||||
/**
|
||||
* Initialize a label draw descriptor from an object's styles in its current state
|
||||
@@ -77,7 +77,7 @@ void lv_obj_init_draw_rect_dsc(struct _lv_obj_t * obj, uint8_t part, lv_draw_rec
|
||||
* If the `opa` filed is set to or the property is equal to `LV_OPA_TRANSP` the rest won't be initialized.
|
||||
* Should be initialized with `lv_draw_label_dsc_init(draw_dsc)`.
|
||||
*/
|
||||
void lv_obj_init_draw_label_dsc(struct _lv_obj_t * obj, uint8_t part, lv_draw_label_dsc_t * draw_dsc);
|
||||
void lv_obj_init_draw_label_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_label_dsc_t * draw_dsc);
|
||||
|
||||
/**
|
||||
* Initialize an image draw descriptor from an object's styles in its current state
|
||||
@@ -86,7 +86,7 @@ void lv_obj_init_draw_label_dsc(struct _lv_obj_t * obj, uint8_t part, lv_draw_la
|
||||
* @param draw_dsc the descriptor the initialize.
|
||||
* Should be initialized with `lv_draw_image_dsc_init(draw_dsc)`.
|
||||
*/
|
||||
void lv_obj_init_draw_img_dsc(struct _lv_obj_t * obj, uint8_t part, lv_draw_img_dsc_t * draw_dsc);
|
||||
void lv_obj_init_draw_img_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_img_dsc_t * draw_dsc);
|
||||
|
||||
|
||||
/**
|
||||
@@ -96,7 +96,7 @@ void lv_obj_init_draw_img_dsc(struct _lv_obj_t * obj, uint8_t part, lv_draw_img_
|
||||
* @param draw_dsc the descriptor the initialize.
|
||||
* Should be initialized with `lv_draw_line_dsc_init(draw_dsc)`.
|
||||
*/
|
||||
void lv_obj_init_draw_line_dsc(struct _lv_obj_t * obj, uint8_t part, lv_draw_line_dsc_t * draw_dsc);
|
||||
void lv_obj_init_draw_line_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_line_dsc_t * draw_dsc);
|
||||
|
||||
/**
|
||||
* Initialize an arc draw descriptor from an object's styles in its current state
|
||||
@@ -105,7 +105,7 @@ void lv_obj_init_draw_line_dsc(struct _lv_obj_t * obj, uint8_t part, lv_draw_lin
|
||||
* @param draw_dsc the descriptor the initialize.
|
||||
* Should be initialized with `lv_draw_arc_dsc_init(draw_dsc)`.
|
||||
*/
|
||||
void lv_obj_init_draw_arc_dsc(struct _lv_obj_t * obj, uint8_t part, lv_draw_arc_dsc_t * draw_dsc);
|
||||
void lv_obj_init_draw_arc_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_arc_dsc_t * draw_dsc);
|
||||
|
||||
/**
|
||||
* Get the required extra size (around the object's part) to draw shadow, outline, value etc.
|
||||
@@ -113,7 +113,7 @@ void lv_obj_init_draw_arc_dsc(struct _lv_obj_t * obj, uint8_t part, lv_draw_arc_
|
||||
* @param part part of the object
|
||||
* @return the extra size required around the object
|
||||
*/
|
||||
lv_coord_t lv_obj_calculate_ext_draw_size(struct _lv_obj_t * obj, uint8_t part);
|
||||
lv_coord_t lv_obj_calculate_ext_draw_size(struct _lv_obj_t * obj, uint32_t part);
|
||||
|
||||
/**
|
||||
* Initialize a draw descriptor used in events.
|
||||
|
||||
@@ -57,10 +57,10 @@ void lv_obj_set_x(lv_obj_t * obj, lv_coord_t x)
|
||||
lv_res_t res_x;
|
||||
lv_style_value_t v_x;
|
||||
|
||||
res_x = lv_obj_get_local_style_prop(obj, LV_PART_MAIN, LV_STATE_DEFAULT, LV_STYLE_X, &v_x);
|
||||
res_x = lv_obj_get_local_style_prop(obj, LV_STYLE_X, &v_x, 0);
|
||||
|
||||
if((res_x == LV_RES_OK && v_x.num != x) || res_x == LV_RES_INV) {
|
||||
lv_obj_set_style_x(obj, LV_PART_MAIN, LV_STATE_DEFAULT, x);
|
||||
lv_obj_set_style_x(obj, x, 0);
|
||||
}
|
||||
|
||||
lv_obj_refr_pos(obj);
|
||||
@@ -76,10 +76,10 @@ void lv_obj_set_y(lv_obj_t * obj, lv_coord_t y)
|
||||
lv_res_t res_y;
|
||||
lv_style_value_t v_y;
|
||||
|
||||
res_y = lv_obj_get_local_style_prop(obj, LV_PART_MAIN, LV_STATE_DEFAULT, LV_STYLE_Y, &v_y);
|
||||
res_y = lv_obj_get_local_style_prop(obj, LV_STYLE_Y, &v_y, 0);
|
||||
|
||||
if((res_y == LV_RES_OK && v_y.num != y) || res_y == LV_RES_INV) {
|
||||
lv_obj_set_style_y(obj, LV_PART_MAIN, LV_STATE_DEFAULT, y);
|
||||
lv_obj_set_style_y(obj, y, 0);
|
||||
}
|
||||
|
||||
lv_obj_refr_pos(obj);
|
||||
@@ -182,10 +182,10 @@ void lv_obj_set_width(lv_obj_t * obj, lv_coord_t w)
|
||||
lv_res_t res_w;
|
||||
lv_style_value_t v_w;
|
||||
|
||||
res_w = lv_obj_get_local_style_prop(obj, LV_PART_MAIN, LV_STATE_DEFAULT, LV_STYLE_WIDTH, &v_w);
|
||||
res_w = lv_obj_get_local_style_prop(obj, LV_STYLE_WIDTH, &v_w, 0);
|
||||
|
||||
if((res_w == LV_RES_OK && v_w.num != w) || res_w == LV_RES_INV) {
|
||||
lv_obj_set_style_width(obj, LV_PART_MAIN, LV_STATE_DEFAULT, w);
|
||||
lv_obj_set_style_width(obj, w, 0);
|
||||
}
|
||||
|
||||
lv_obj_refr_size(obj);
|
||||
@@ -197,10 +197,10 @@ void lv_obj_set_height(lv_obj_t * obj, lv_coord_t h)
|
||||
lv_res_t res_h;
|
||||
lv_style_value_t v_h;
|
||||
|
||||
res_h = lv_obj_get_local_style_prop(obj, LV_PART_MAIN, LV_STATE_DEFAULT, LV_STYLE_HEIGHT, &v_h);
|
||||
res_h = lv_obj_get_local_style_prop(obj, LV_STYLE_HEIGHT, &v_h, 0);
|
||||
|
||||
if((res_h == LV_RES_OK && v_h.num != h) || res_h == LV_RES_INV) {
|
||||
lv_obj_set_style_height(obj, LV_PART_MAIN, LV_STATE_DEFAULT, h);
|
||||
lv_obj_set_style_height(obj, h, 0);
|
||||
}
|
||||
|
||||
lv_obj_refr_size(obj);
|
||||
@@ -226,7 +226,7 @@ void lv_obj_set_layout(lv_obj_t * obj, uint32_t layout)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
|
||||
lv_obj_set_style_layout(obj, LV_PART_MAIN, LV_STATE_DEFAULT, layout);
|
||||
lv_obj_set_style_layout(obj, layout, 0);
|
||||
|
||||
lv_obj_mark_layout_as_dirty(obj);
|
||||
}
|
||||
@@ -290,7 +290,7 @@ uint32_t lv_layout_register(lv_layout_update_cb_t cb)
|
||||
|
||||
void lv_obj_align(lv_obj_t * obj, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs)
|
||||
{
|
||||
lv_obj_set_style_align(obj, LV_PART_MAIN, LV_STATE_DEFAULT, align);
|
||||
lv_obj_set_style_align(obj, align, 0);
|
||||
lv_obj_set_pos(obj, x_ofs, y_ofs);
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ void lv_obj_align_to(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv
|
||||
|
||||
x += x_ofs + base->coords.x1 - parent->coords.x1 + lv_obj_get_scroll_left(parent);
|
||||
y += y_ofs + base->coords.y1 - parent->coords.y1 + lv_obj_get_scroll_top(parent);
|
||||
lv_obj_set_style_align(obj, LV_PART_MAIN, LV_STATE_DEFAULT, LV_ALIGN_TOP_LEFT);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_TOP_LEFT, 0);
|
||||
lv_obj_set_pos(obj, x, y);
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
typedef struct {
|
||||
lv_obj_t * obj;
|
||||
lv_style_prop_t prop;
|
||||
uint8_t part;
|
||||
lv_style_selector_t selector;
|
||||
lv_style_value_t start_value;
|
||||
lv_style_value_t end_value;
|
||||
} trans_t;
|
||||
@@ -42,13 +42,13 @@ typedef enum {
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static lv_style_t * get_local_style(lv_obj_t * obj, uint32_t part, uint32_t state);
|
||||
static lv_style_t * get_local_style(lv_obj_t * obj, lv_style_selector_t selector);
|
||||
static lv_obj_style_t * get_trans_style(lv_obj_t * obj, uint32_t part);
|
||||
static bool get_prop_core(const lv_obj_t * obj, uint8_t part, lv_style_prop_t prop, lv_style_value_t * v);
|
||||
static bool get_prop_core(const lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, lv_style_value_t * v);
|
||||
static lv_style_value_t apply_color_filter(const lv_obj_t * obj, uint32_t part, lv_style_value_t v);
|
||||
static void report_style_change_core(void * style, lv_obj_t * obj);
|
||||
static void refresh_children_style(lv_obj_t * obj);
|
||||
static bool trans_del(lv_obj_t * obj, uint8_t part, lv_style_prop_t prop, trans_t * tr_limit);
|
||||
static bool trans_del(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, trans_t * tr_limit);
|
||||
static void trans_anim_cb(void * _tr, int32_t v);
|
||||
static void trans_anim_start_cb(lv_anim_t * a);
|
||||
static void trans_anim_ready_cb(lv_anim_t * a);
|
||||
@@ -73,9 +73,9 @@ void _lv_obj_style_init(void)
|
||||
_lv_ll_init(&LV_GC_ROOT(_lv_obj_style_trans_ll), sizeof(trans_t));
|
||||
}
|
||||
|
||||
void lv_obj_add_style(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_style_t * style)
|
||||
void lv_obj_add_style(struct _lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector)
|
||||
{
|
||||
trans_del(obj, part, 0xFF, NULL);
|
||||
trans_del(obj, selector, LV_STYLE_PROP_ALL, NULL);
|
||||
|
||||
uint32_t i;
|
||||
/*Go after the transition and local styles*/
|
||||
@@ -98,19 +98,22 @@ void lv_obj_add_style(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_
|
||||
|
||||
lv_memset_00(&obj->styles[i], sizeof(lv_obj_style_t));
|
||||
obj->styles[i].style = style;
|
||||
obj->styles[i].part = part;
|
||||
obj->styles[i].state = state;
|
||||
obj->styles[i].selector = selector;
|
||||
|
||||
lv_obj_refresh_style(obj, part, LV_STYLE_PROP_ALL);
|
||||
lv_obj_refresh_style(obj, selector, LV_STYLE_PROP_ALL);
|
||||
}
|
||||
|
||||
void lv_obj_remove_style(lv_obj_t * obj, uint32_t part, uint32_t state, lv_style_t * style)
|
||||
void lv_obj_remove_style(lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector)
|
||||
{
|
||||
lv_state_t state = lv_obj_style_get_selector_state(selector);
|
||||
lv_part_t part = lv_obj_style_get_selector_part(selector);
|
||||
uint32_t i = 0;
|
||||
bool deleted = false;
|
||||
while(i < obj->style_cnt) {
|
||||
if((state != LV_STATE_ANY && obj->styles[i].state != state) ||
|
||||
(part != LV_PART_ANY && obj->styles[i].part != part) ||
|
||||
lv_state_t state_act = lv_obj_style_get_selector_state(obj->styles[i].selector);
|
||||
lv_part_t part_act = lv_obj_style_get_selector_part(obj->styles[i].selector);
|
||||
if((state != LV_STATE_ANY && state_act != state) ||
|
||||
(part != LV_PART_ANY && part_act != part) ||
|
||||
(style != NULL && style != obj->styles[i].style))
|
||||
{
|
||||
i++;
|
||||
@@ -159,13 +162,16 @@ void lv_obj_report_style_change(lv_style_t * style)
|
||||
}
|
||||
}
|
||||
|
||||
void lv_obj_refresh_style(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop)
|
||||
void lv_obj_refresh_style(lv_obj_t * obj, lv_style_selector_t selector, lv_style_prop_t prop)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
|
||||
if(!style_refr) return;
|
||||
|
||||
lv_obj_invalidate(obj);
|
||||
|
||||
lv_part_t part = lv_obj_style_get_selector_part(selector);
|
||||
|
||||
if((part == LV_PART_ANY || part == LV_PART_MAIN) && (prop == LV_STYLE_PROP_ALL || (prop & LV_STYLE_PROP_LAYOUT_REFR))) {
|
||||
lv_event_send(obj, LV_EVENT_STYLE_CHANGED, NULL); /*To update layout*/
|
||||
} else if(prop & LV_STYLE_PROP_EXT_DRAW) {
|
||||
@@ -187,7 +193,7 @@ void lv_obj_enable_style_refresh(bool en)
|
||||
style_refr = en;
|
||||
}
|
||||
|
||||
lv_style_value_t lv_obj_get_style_prop(const lv_obj_t * obj, uint8_t part, lv_style_prop_t prop)
|
||||
lv_style_value_t lv_obj_get_style_prop(const lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop)
|
||||
{
|
||||
lv_style_value_t value_act;
|
||||
bool inherit = prop & LV_STYLE_PROP_INHERIT ? true : false;
|
||||
@@ -216,21 +222,20 @@ lv_style_value_t lv_obj_get_style_prop(const lv_obj_t * obj, uint8_t part, lv_st
|
||||
return value_act;
|
||||
}
|
||||
|
||||
void lv_obj_set_local_style_prop(lv_obj_t * obj, uint32_t part, uint32_t state, lv_style_prop_t prop, lv_style_value_t value)
|
||||
void lv_obj_set_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_t * style = get_local_style(obj, part, state);
|
||||
lv_style_t * style = get_local_style(obj, selector);
|
||||
lv_style_set_prop(style, prop, value);
|
||||
lv_obj_refresh_style(obj, part, prop);
|
||||
lv_obj_refresh_style(obj, selector, prop);
|
||||
}
|
||||
|
||||
|
||||
lv_res_t lv_obj_get_local_style_prop(lv_obj_t * obj, uint32_t part, uint32_t state, lv_style_prop_t prop, lv_style_value_t * value)
|
||||
lv_res_t lv_obj_get_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t * value, lv_style_selector_t selector)
|
||||
{
|
||||
uint32_t i;
|
||||
for(i = 0; i < obj->style_cnt; i++) {
|
||||
if(obj->styles[i].is_local &&
|
||||
obj->styles[i].part == part &&
|
||||
obj->styles[i].state == state)
|
||||
obj->styles[i].selector == selector)
|
||||
{
|
||||
return lv_style_get_prop(obj->styles[i].style, prop, value);
|
||||
}
|
||||
@@ -239,7 +244,7 @@ lv_res_t lv_obj_get_local_style_prop(lv_obj_t * obj, uint32_t part, uint32_t sta
|
||||
return LV_RES_INV;
|
||||
}
|
||||
|
||||
bool lv_obj_remove_local_style_prop(lv_obj_t * obj, uint32_t part, uint32_t state, lv_style_prop_t prop)
|
||||
bool lv_obj_remove_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_selector_t selector)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
|
||||
@@ -247,8 +252,7 @@ bool lv_obj_remove_local_style_prop(lv_obj_t * obj, uint32_t part, uint32_t stat
|
||||
/*Find the style*/
|
||||
for(i = 0; i < obj->style_cnt; i++) {
|
||||
if(obj->styles[i].is_local &&
|
||||
obj->styles[i].state == state &&
|
||||
obj->styles[i].part == part) {
|
||||
obj->styles[i].selector == selector) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -259,7 +263,7 @@ bool lv_obj_remove_local_style_prop(lv_obj_t * obj, uint32_t part, uint32_t stat
|
||||
return lv_style_remove_prop(obj->styles[i].style, prop);
|
||||
}
|
||||
|
||||
void _lv_obj_style_create_transition(lv_obj_t * obj, lv_style_prop_t prop, uint8_t part, lv_state_t prev_state,
|
||||
void _lv_obj_style_create_transition(lv_obj_t * obj, lv_style_prop_t prop, lv_part_t part, lv_state_t prev_state,
|
||||
lv_state_t new_state, uint32_t time, uint32_t delay, const lv_anim_path_t * path)
|
||||
{
|
||||
trans_t * tr;
|
||||
@@ -298,7 +302,7 @@ void _lv_obj_style_create_transition(lv_obj_t * obj, lv_style_prop_t prop, uint8
|
||||
if(tr) {
|
||||
tr->obj = obj;
|
||||
tr->prop = prop;
|
||||
tr->part = part;
|
||||
tr->selector = part;
|
||||
|
||||
lv_anim_t a;
|
||||
lv_anim_init(&a);
|
||||
@@ -324,9 +328,11 @@ _lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t sta
|
||||
for(i = 0; i < obj->style_cnt; i++) {
|
||||
if(obj->styles[i].is_trans) continue;
|
||||
|
||||
lv_state_t state_act = lv_obj_style_get_selector_state(obj->styles[i].selector);
|
||||
lv_part_t part_act = lv_obj_style_get_selector_part(obj->styles[i].selector);
|
||||
/*The style is valid for a stat but not the other*/
|
||||
bool valid1 = obj->styles[i].state & (~state1) ? false : true;
|
||||
bool valid2 = obj->styles[i].state & (~state2) ? false : true;
|
||||
bool valid1 = state_act & (~state1) ? false : true;
|
||||
bool valid2 = state_act & (~state2) ? false : true;
|
||||
if(valid1 != valid2) {
|
||||
lv_style_t * style = obj->styles[i].style;
|
||||
lv_style_value_t v;
|
||||
@@ -340,7 +346,7 @@ _lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t sta
|
||||
else if(lv_style_get_prop(style, LV_STYLE_PAD_ROW, &v)) res_tmp = _LV_STYLE_STATE_CMP_DIFF_LAYOUT;
|
||||
|
||||
if(res_tmp == _LV_STYLE_STATE_CMP_DIFF_LAYOUT) {
|
||||
if(obj->styles[i].part == LV_PART_MAIN) return _LV_STYLE_STATE_CMP_DIFF_LAYOUT;
|
||||
if(part_act == LV_PART_MAIN) return _LV_STYLE_STATE_CMP_DIFF_LAYOUT;
|
||||
else {
|
||||
res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
continue;
|
||||
@@ -362,7 +368,7 @@ _lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t sta
|
||||
else if(lv_style_get_prop(style, LV_STYLE_LINE_WIDTH, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else {
|
||||
if(res != _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD) {
|
||||
if((obj->styles[i].part == LV_PART_MAIN || obj->styles[i].part == LV_PART_SCROLLBAR)) {
|
||||
if((part_act == LV_PART_MAIN || part_act == LV_PART_SCROLLBAR)) {
|
||||
res = _LV_STYLE_STATE_CMP_DIFF_REDRAW;
|
||||
}
|
||||
}
|
||||
@@ -398,6 +404,16 @@ void lv_obj_fade_out(lv_obj_t * obj, uint32_t time, uint32_t delay)
|
||||
lv_anim_start(&a);
|
||||
}
|
||||
|
||||
lv_state_t lv_obj_style_get_selector_state(lv_style_selector_t selector)
|
||||
{
|
||||
return selector & 0xFFFF;
|
||||
}
|
||||
|
||||
lv_part_t lv_obj_style_get_selector_part(lv_style_selector_t selector)
|
||||
{
|
||||
return selector & 0xFF0000;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
@@ -410,13 +426,12 @@ void lv_obj_fade_out(lv_obj_t * obj, uint32_t time, uint32_t delay)
|
||||
* @param state the state in whose local style to get
|
||||
* @return pointer to the local style
|
||||
*/
|
||||
static lv_style_t * get_local_style(lv_obj_t * obj, uint32_t part, uint32_t state)
|
||||
static lv_style_t * get_local_style(lv_obj_t * obj, lv_style_selector_t selector)
|
||||
{
|
||||
uint32_t i;
|
||||
for(i = 0; i < obj->style_cnt; i++) {
|
||||
if(obj->styles[i].is_local &&
|
||||
obj->styles[i].part == part &&
|
||||
obj->styles[i].state == state)
|
||||
obj->styles[i].selector == selector)
|
||||
{
|
||||
return obj->styles[i].style;
|
||||
}
|
||||
@@ -437,8 +452,7 @@ static lv_style_t * get_local_style(lv_obj_t * obj, uint32_t part, uint32_t stat
|
||||
obj->styles[i].style = lv_mem_alloc(sizeof(lv_style_t));
|
||||
lv_style_init(obj->styles[i].style);
|
||||
obj->styles[i].is_local = 1;
|
||||
obj->styles[i].part = part;
|
||||
obj->styles[i].state = state;
|
||||
obj->styles[i].selector = selector;
|
||||
return obj->styles[i].style;
|
||||
}
|
||||
|
||||
@@ -450,11 +464,11 @@ static lv_style_t * get_local_style(lv_obj_t * obj, uint32_t part, uint32_t stat
|
||||
* @param state the state in whose local style to get
|
||||
* @return pointer to the transition style
|
||||
*/
|
||||
static lv_obj_style_t * get_trans_style(lv_obj_t * obj, uint32_t part)
|
||||
static lv_obj_style_t * get_trans_style(lv_obj_t * obj, lv_style_selector_t selector)
|
||||
{
|
||||
uint32_t i;
|
||||
for(i = 0; i < obj->style_cnt; i++) {
|
||||
if(obj->styles[i].is_trans && obj->styles[i].part == part) break;
|
||||
if(obj->styles[i].is_trans && obj->styles[i].selector == selector) break;
|
||||
}
|
||||
|
||||
/*Already have a transition style for it*/
|
||||
@@ -471,12 +485,12 @@ static lv_obj_style_t * get_trans_style(lv_obj_t * obj, uint32_t part)
|
||||
obj->styles[0].style = lv_mem_alloc(sizeof(lv_style_t));
|
||||
lv_style_init(obj->styles[0].style);
|
||||
obj->styles[0].is_trans = 1;
|
||||
obj->styles[0].part = part;
|
||||
obj->styles[0].selector = selector;
|
||||
return &obj->styles[0];
|
||||
}
|
||||
|
||||
|
||||
static bool get_prop_core(const lv_obj_t * obj, uint8_t part, lv_style_prop_t prop, lv_style_value_t * v)
|
||||
static bool get_prop_core(const lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, lv_style_value_t * v)
|
||||
{
|
||||
uint8_t group = 1 << _lv_style_get_prop_group(prop);
|
||||
int32_t weight = -1;
|
||||
@@ -490,7 +504,10 @@ static bool get_prop_core(const lv_obj_t * obj, uint8_t part, lv_style_prop_t pr
|
||||
lv_obj_style_t * obj_style = &obj->styles[i];
|
||||
if(obj_style->is_trans == false) break;
|
||||
if(skip_trans) continue;
|
||||
if(obj_style->part != part) continue;
|
||||
|
||||
lv_part_t part_act = lv_obj_style_get_selector_part(obj->styles[i].selector);
|
||||
|
||||
if(part_act != part) continue;
|
||||
if((obj_style->style->has_group & group) == 0) continue;
|
||||
found = lv_style_get_prop(obj_style->style, prop, &value_tmp);
|
||||
if(found) {
|
||||
@@ -501,26 +518,28 @@ static bool get_prop_core(const lv_obj_t * obj, uint8_t part, lv_style_prop_t pr
|
||||
|
||||
for(; i < obj->style_cnt; i++) {
|
||||
lv_obj_style_t * obj_style = &obj->styles[i];
|
||||
if(obj_style->part != part) continue;
|
||||
lv_part_t part_act = lv_obj_style_get_selector_part(obj->styles[i].selector);
|
||||
lv_state_t state_act = lv_obj_style_get_selector_state(obj->styles[i].selector);
|
||||
if(part_act != part) continue;
|
||||
|
||||
if((obj_style->style->has_group & group) == 0) continue;
|
||||
|
||||
/*Be sure the style not specifies other state than the requested.
|
||||
*E.g. For HOVER+PRESS object state, HOVER style only is OK, but HOVER+FOCUS style is not*/
|
||||
if((obj_style->state & state_inv)) continue;
|
||||
if((state_act & state_inv)) continue;
|
||||
|
||||
/*Check only better candidates*/
|
||||
if(obj_style->state <= weight) continue;
|
||||
if(state_act <= weight) continue;
|
||||
|
||||
found = lv_style_get_prop(obj_style->style, prop, &value_tmp);
|
||||
|
||||
if(found) {
|
||||
if(obj_style->state == state) {
|
||||
if(state_act == state) {
|
||||
*v = value_tmp;
|
||||
return true;
|
||||
}
|
||||
if(weight < obj_style->state) {
|
||||
weight = obj_style->state;
|
||||
if(weight < state_act) {
|
||||
weight = state_act;
|
||||
*v = value_tmp;
|
||||
}
|
||||
}
|
||||
@@ -591,7 +610,7 @@ static void refresh_children_style(lv_obj_t * obj)
|
||||
* @param prop a property or 0xFF to remove all properties
|
||||
* @param tr_limit delete transitions only "older" than this. `NULL` if not used
|
||||
*/
|
||||
static bool trans_del(lv_obj_t * obj, uint8_t part, lv_style_prop_t prop, trans_t * tr_limit)
|
||||
static bool trans_del(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, trans_t * tr_limit)
|
||||
{
|
||||
trans_t * tr;
|
||||
trans_t * tr_prev;
|
||||
@@ -603,12 +622,12 @@ static bool trans_del(lv_obj_t * obj, uint8_t part, lv_style_prop_t prop, trans_
|
||||
/*'tr' might be deleted, so get the next object while 'tr' is valid*/
|
||||
tr_prev = _lv_ll_get_prev(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr);
|
||||
|
||||
if(tr->obj == obj && (part == tr->part || part == LV_PART_ANY) && (prop == tr->prop || prop == LV_STYLE_PROP_ALL)) {
|
||||
if(tr->obj == obj && (part == tr->selector || part == LV_PART_ANY) && (prop == tr->prop || prop == LV_STYLE_PROP_ALL)) {
|
||||
/*Remove the transitioned property from trans. style
|
||||
*to allow changing it by normal styles*/
|
||||
uint32_t i;
|
||||
for(i = 0; i < obj->style_cnt; i++) {
|
||||
if(obj->styles[i].is_trans && (part == LV_PART_ANY || obj->styles[i].part == part)) {
|
||||
if(obj->styles[i].is_trans && (part == LV_PART_ANY || obj->styles[i].selector == part)) {
|
||||
lv_style_remove_prop(obj->styles[i].style, tr->prop);
|
||||
lv_anim_del(tr, NULL);
|
||||
_lv_ll_remove(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr);
|
||||
@@ -630,7 +649,7 @@ static void trans_anim_cb(void * _tr, int32_t v)
|
||||
|
||||
uint32_t i;
|
||||
for(i = 0; i < obj->style_cnt; i++) {
|
||||
if(obj->styles[i].is_trans == 0 || obj->styles[i].part != tr->part) continue;
|
||||
if(obj->styles[i].is_trans == 0 || obj->styles[i].selector != tr->selector) continue;
|
||||
|
||||
lv_style_value_t value_final;
|
||||
switch (tr->prop) {
|
||||
@@ -678,7 +697,7 @@ static void trans_anim_cb(void * _tr, int32_t v)
|
||||
}
|
||||
}
|
||||
lv_style_set_prop(obj->styles[i].style, tr->prop, value_final);
|
||||
if (refr) lv_obj_refresh_style(tr->obj, tr->part, tr->prop);
|
||||
if (refr) lv_obj_refresh_style(tr->obj, tr->selector, tr->prop);
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -689,18 +708,19 @@ static void trans_anim_start_cb(lv_anim_t * a)
|
||||
{
|
||||
trans_t * tr = a->var;
|
||||
|
||||
tr->start_value = lv_obj_get_style_prop(tr->obj, tr->part, tr->prop);
|
||||
lv_part_t part = lv_obj_style_get_selector_part(tr->selector);
|
||||
tr->start_value = lv_obj_get_style_prop(tr->obj, part, tr->prop);
|
||||
|
||||
/*Init prop to an invalid values to be sure `trans_del` won't delete this added `tr`*/
|
||||
lv_style_prop_t prop_tmp = tr->prop;
|
||||
tr->prop = LV_STYLE_PROP_INV;
|
||||
|
||||
/*Delete the related transitions if any*/
|
||||
trans_del(tr->obj, tr->part, prop_tmp, tr);
|
||||
trans_del(tr->obj, part, prop_tmp, tr);
|
||||
|
||||
tr->prop = prop_tmp;
|
||||
|
||||
lv_obj_style_t * style_trans = get_trans_style(tr->obj, tr->part);
|
||||
lv_obj_style_t * style_trans = get_trans_style(tr->obj, tr->selector);
|
||||
lv_style_set_prop(style_trans->style, tr->prop, tr->start_value); /*Be sure `trans_style` has a valid value*/
|
||||
|
||||
}
|
||||
@@ -717,7 +737,7 @@ static void trans_anim_ready_cb(lv_anim_t * a)
|
||||
bool running = false;
|
||||
trans_t * tr_i;
|
||||
_LV_LL_READ(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr_i) {
|
||||
if(tr_i != tr && tr_i->obj == tr->obj && tr_i->part == tr->part && tr_i->prop == tr->prop) {
|
||||
if(tr_i != tr && tr_i->obj == tr->obj && tr_i->selector == tr->selector && tr_i->prop == tr->prop) {
|
||||
running = true;
|
||||
break;
|
||||
}
|
||||
@@ -726,7 +746,7 @@ static void trans_anim_ready_cb(lv_anim_t * a)
|
||||
if(!running) {
|
||||
uint32_t i;
|
||||
for(i = 0; i < obj->style_cnt; i++) {
|
||||
if(obj->styles[i].is_trans && obj->styles[i].part == tr->part) {
|
||||
if(obj->styles[i].is_trans && obj->styles[i].selector == tr->selector) {
|
||||
_lv_ll_remove(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr);
|
||||
lv_mem_free(tr);
|
||||
|
||||
@@ -734,7 +754,7 @@ static void trans_anim_ready_cb(lv_anim_t * a)
|
||||
lv_style_remove_prop(obj_style->style, prop);
|
||||
|
||||
if(lv_style_is_empty(obj->styles[i].style)) {
|
||||
lv_obj_remove_style(obj, obj_style->part, obj_style->state, obj_style->style);
|
||||
lv_obj_remove_style(obj, obj_style->style, obj_style->selector);
|
||||
//trans_del(obj, obj_style->part, prop, NULL);
|
||||
|
||||
}
|
||||
@@ -746,12 +766,12 @@ static void trans_anim_ready_cb(lv_anim_t * a)
|
||||
|
||||
static void fade_anim_cb(void * obj, int32_t v)
|
||||
{
|
||||
lv_obj_set_style_opa(obj, LV_PART_MAIN, LV_STATE_DEFAULT, v);
|
||||
lv_obj_set_style_opa(obj, v, 0);
|
||||
}
|
||||
|
||||
static void fade_in_anim_ready(lv_anim_t * a)
|
||||
{
|
||||
lv_obj_remove_local_style_prop(a->var, LV_PART_MAIN,LV_STATE_DEFAULT, LV_STYLE_OPA);
|
||||
lv_obj_remove_local_style_prop(a->var, LV_STYLE_OPA, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,12 +33,13 @@ typedef enum {
|
||||
_LV_STYLE_STATE_CMP_DIFF_LAYOUT, /*The differences can be shown with a simple redraw*/
|
||||
} _lv_style_state_cmp_t;
|
||||
|
||||
typedef uint32_t lv_style_selector_t;
|
||||
|
||||
typedef struct {
|
||||
lv_style_t * style;
|
||||
uint16_t state;
|
||||
uint8_t part;
|
||||
uint8_t is_local :1;
|
||||
uint8_t is_trans :1;
|
||||
uint32_t selector;
|
||||
uint32_t is_local :1;
|
||||
uint32_t is_trans :1;
|
||||
}lv_obj_style_t;
|
||||
|
||||
/**********************
|
||||
@@ -59,7 +60,7 @@ void _lv_obj_style_init(void);
|
||||
* @param style pointer to a style to add
|
||||
* @example lv_obj_add_style_no_refresh(slider, LV_PART_KNOB, LV_STATE_PRESSED, &style1);
|
||||
*/
|
||||
void lv_obj_add_style(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_style_t * style);
|
||||
void lv_obj_add_style(struct _lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector);
|
||||
|
||||
/**
|
||||
* Add a style to an object.
|
||||
@@ -71,7 +72,7 @@ void lv_obj_add_style(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_
|
||||
* @example lv_obj_remove_style(obj, LV_PART_MAIN, LV_STATE_ANY, &style); //Remove all styles from the main part
|
||||
* @example lv_obj_remove_style(obj, LV_PART_ANY, LV_STATE_ANY, NULL); //Remove all styles
|
||||
*/
|
||||
void lv_obj_remove_style(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_style_t * style);
|
||||
void lv_obj_remove_style(struct _lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector);
|
||||
|
||||
/**
|
||||
* Remove all styles from an object
|
||||
@@ -79,7 +80,7 @@ void lv_obj_remove_style(struct _lv_obj_t * obj, uint32_t part, uint32_t state,
|
||||
*/
|
||||
static inline void lv_obj_remove_style_all(struct _lv_obj_t * obj)
|
||||
{
|
||||
lv_obj_remove_style(obj, LV_PART_ANY, LV_STATE_ANY, NULL);
|
||||
lv_obj_remove_style(obj, NULL, LV_PART_ANY | LV_STATE_ANY);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,7 +117,7 @@ void lv_obj_enable_style_refresh(bool en);
|
||||
* @return the value of the property.
|
||||
* Should be read from the correct field of the `lv_style_value_t` according to the type of the property.
|
||||
*/
|
||||
lv_style_value_t lv_obj_get_style_prop(const struct _lv_obj_t * obj, uint8_t part, lv_style_prop_t prop);
|
||||
lv_style_value_t lv_obj_get_style_prop(const struct _lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop);
|
||||
|
||||
/**
|
||||
* Set local style property on an object's part and state.
|
||||
@@ -126,9 +127,9 @@ lv_style_value_t lv_obj_get_style_prop(const struct _lv_obj_t * obj, uint8_t par
|
||||
* @param prop the property
|
||||
* @param value value of the property. The correct element should be set according to the type of the property
|
||||
*/
|
||||
void lv_obj_set_local_style_prop(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_style_prop_t prop, lv_style_value_t value);
|
||||
void lv_obj_set_local_style_prop(struct _lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t value, lv_style_selector_t selector);
|
||||
|
||||
lv_res_t lv_obj_get_local_style_prop(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_style_prop_t prop, lv_style_value_t * value);
|
||||
lv_res_t lv_obj_get_local_style_prop(struct _lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t * value, lv_style_selector_t selector);
|
||||
|
||||
/**
|
||||
* Remove a local style property from a part of an object with a given state.
|
||||
@@ -138,7 +139,7 @@ lv_res_t lv_obj_get_local_style_prop(struct _lv_obj_t * obj, uint32_t part, uint
|
||||
* @param prop a style property to remove.
|
||||
* @return true the property was found and removed; false: the property was not found
|
||||
*/
|
||||
bool lv_obj_remove_local_style_prop(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_style_prop_t prop);
|
||||
bool lv_obj_remove_local_style_prop(struct _lv_obj_t * obj, lv_style_prop_t prop, lv_style_selector_t selector);
|
||||
|
||||
/**
|
||||
* Used internally to create a style tarnsition
|
||||
@@ -151,7 +152,7 @@ bool lv_obj_remove_local_style_prop(struct _lv_obj_t * obj, uint32_t part, uint3
|
||||
* @param delay
|
||||
* @param path
|
||||
*/
|
||||
void _lv_obj_style_create_transition(struct _lv_obj_t * obj, lv_style_prop_t prop, uint8_t part, lv_state_t prev_state,
|
||||
void _lv_obj_style_create_transition(struct _lv_obj_t * obj, lv_style_prop_t prop, lv_part_t part, lv_state_t prev_state,
|
||||
lv_state_t new_state, uint32_t time, uint32_t delay, const lv_anim_path_t * path);
|
||||
|
||||
/**
|
||||
@@ -179,28 +180,32 @@ void lv_obj_fade_in(struct _lv_obj_t * obj, uint32_t time, uint32_t delay);
|
||||
*/
|
||||
void lv_obj_fade_out(struct _lv_obj_t * obj, uint32_t time, uint32_t delay);
|
||||
|
||||
lv_state_t lv_obj_style_get_selector_state(lv_style_selector_t selector);
|
||||
|
||||
lv_part_t lv_obj_style_get_selector_part(lv_style_selector_t selector);
|
||||
|
||||
#include "lv_obj_style_gen.h"
|
||||
|
||||
static inline void lv_obj_set_style_pad_all(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value) {
|
||||
lv_obj_set_style_pad_left(obj, part, state, value);
|
||||
lv_obj_set_style_pad_right(obj, part, state, value);
|
||||
lv_obj_set_style_pad_top(obj, part, state, value);
|
||||
lv_obj_set_style_pad_bottom(obj, part, state, value);
|
||||
static inline void lv_obj_set_style_pad_all(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) {
|
||||
lv_obj_set_style_pad_left(obj, value, selector);
|
||||
lv_obj_set_style_pad_right(obj, value, selector);
|
||||
lv_obj_set_style_pad_top(obj, value, selector);
|
||||
lv_obj_set_style_pad_bottom(obj, value, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_pad_hor(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value) {
|
||||
lv_obj_set_style_pad_left(obj, part, state, value);
|
||||
lv_obj_set_style_pad_right(obj, part, state, value);
|
||||
static inline void lv_obj_set_style_pad_hor(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) {
|
||||
lv_obj_set_style_pad_left(obj, value, selector);
|
||||
lv_obj_set_style_pad_right(obj, value, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_pad_ver(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value) {
|
||||
lv_obj_set_style_pad_top(obj, part, state, value);
|
||||
lv_obj_set_style_pad_bottom(obj, part, state, value);
|
||||
static inline void lv_obj_set_style_pad_ver(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) {
|
||||
lv_obj_set_style_pad_top(obj, value, selector);
|
||||
lv_obj_set_style_pad_bottom(obj, value, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_pad_gap(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value) {
|
||||
lv_obj_set_style_pad_row(obj, part, state, value);
|
||||
lv_obj_set_style_pad_column(obj, part, state, value);
|
||||
static inline void lv_obj_set_style_pad_gap(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) {
|
||||
lv_obj_set_style_pad_row(obj, value, selector);
|
||||
lv_obj_set_style_pad_column(obj, value, selector);
|
||||
}
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -490,659 +490,659 @@ static inline const void * lv_obj_get_style_arc_img_src(const struct _lv_obj_t *
|
||||
return (const void *)v.ptr;
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_radius(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_radius(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_RADIUS, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_RADIUS, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_clip_corner(struct _lv_obj_t * obj, uint32_t part, uint32_t state, bool value)
|
||||
static inline void lv_obj_set_style_clip_corner(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_CLIP_CORNER, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_CLIP_CORNER, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_transform_width(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_transform_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_TRANSFORM_WIDTH, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_WIDTH, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_transform_height(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_transform_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_TRANSFORM_HEIGHT, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_HEIGHT, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_transform_zoom(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_transform_zoom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_TRANSFORM_ZOOM, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_ZOOM, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_transform_angle(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_transform_angle(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_TRANSFORM_ANGLE, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_ANGLE, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_opa(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_opa_t value)
|
||||
static inline void lv_obj_set_style_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_OPA, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_OPA, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, uint32_t part, uint32_t state, const lv_color_filter_dsc_t * value)
|
||||
static inline void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.ptr = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_COLOR_FILTER_DSC, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_COLOR_FILTER_DSC, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_color_filter_opa(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_opa_t value)
|
||||
static inline void lv_obj_set_style_color_filter_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_COLOR_FILTER_OPA, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_COLOR_FILTER_OPA, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_anim_time(struct _lv_obj_t * obj, uint32_t part, uint32_t state, uint32_t value)
|
||||
static inline void lv_obj_set_style_anim_time(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_ANIM_TIME, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_ANIM_TIME, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_transition(struct _lv_obj_t * obj, uint32_t part, uint32_t state, const lv_style_transition_dsc_t * value)
|
||||
static inline void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.ptr = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_TRANSITION, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSITION, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_size(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_size(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_SIZE, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_SIZE, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_blend_mode(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_blend_mode_t value)
|
||||
static inline void lv_obj_set_style_blend_mode(struct _lv_obj_t * obj, lv_blend_mode_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BLEND_MODE, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BLEND_MODE, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_pad_top(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_pad_top(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_PAD_TOP, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_TOP, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_pad_bottom(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_pad_bottom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_PAD_BOTTOM, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_BOTTOM, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_pad_left(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_pad_left(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_PAD_LEFT, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_LEFT, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_pad_right(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_pad_right(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_PAD_RIGHT, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_RIGHT, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_pad_row(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_pad_row(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_PAD_ROW, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_ROW, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_pad_column(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_pad_column(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_PAD_COLUMN, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_COLUMN, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_width(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_WIDTH, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_WIDTH, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_height(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_HEIGHT, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_HEIGHT, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_x(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_X, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_X, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_y(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_Y, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_Y, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_align(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_align_t value)
|
||||
static inline void lv_obj_set_style_align(struct _lv_obj_t * obj, lv_align_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_ALIGN, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_ALIGN, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_layout(struct _lv_obj_t * obj, uint32_t part, uint32_t state, uint16_t value)
|
||||
static inline void lv_obj_set_style_layout(struct _lv_obj_t * obj, uint16_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_LAYOUT, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_LAYOUT, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_bg_color(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_bg_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BG_COLOR, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_COLOR, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_bg_color_filtered(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_bg_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BG_COLOR_FILTERED, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_COLOR_FILTERED, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_bg_opa(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_opa_t value)
|
||||
static inline void lv_obj_set_style_bg_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BG_OPA, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_OPA, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_bg_grad_color(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_bg_grad_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BG_GRAD_COLOR, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD_COLOR, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_bg_grad_color_filtered(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_bg_grad_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BG_GRAD_COLOR_FILTERED, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD_COLOR_FILTERED, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_bg_grad_dir(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_grad_dir_t value)
|
||||
static inline void lv_obj_set_style_bg_grad_dir(struct _lv_obj_t * obj, lv_grad_dir_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BG_GRAD_DIR, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD_DIR, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_bg_main_stop(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_bg_main_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BG_MAIN_STOP, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_MAIN_STOP, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_bg_grad_stop(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_bg_grad_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BG_GRAD_STOP, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD_STOP, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_bg_img_src(struct _lv_obj_t * obj, uint32_t part, uint32_t state, const void * value)
|
||||
static inline void lv_obj_set_style_bg_img_src(struct _lv_obj_t * obj, const void * value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.ptr = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BG_IMG_SRC, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_SRC, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_bg_img_opa(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_opa_t value)
|
||||
static inline void lv_obj_set_style_bg_img_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BG_IMG_OPA, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_OPA, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_bg_img_recolor(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_bg_img_recolor(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BG_IMG_RECOLOR, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_RECOLOR, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_bg_img_recolor_filtered(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_bg_img_recolor_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BG_IMG_RECOLOR_FILTERED, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_RECOLOR_FILTERED, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_bg_img_recolor_opa(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_opa_t value)
|
||||
static inline void lv_obj_set_style_bg_img_recolor_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BG_IMG_RECOLOR_OPA, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_RECOLOR_OPA, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_bg_img_tiled(struct _lv_obj_t * obj, uint32_t part, uint32_t state, bool value)
|
||||
static inline void lv_obj_set_style_bg_img_tiled(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BG_IMG_TILED, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_TILED, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_border_color(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_border_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BORDER_COLOR, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_COLOR, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_border_color_filtered(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_border_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BORDER_COLOR_FILTERED, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_COLOR_FILTERED, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_border_opa(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_opa_t value)
|
||||
static inline void lv_obj_set_style_border_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BORDER_OPA, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_OPA, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_border_width(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_border_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BORDER_WIDTH, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_WIDTH, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_border_side(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_border_side_t value)
|
||||
static inline void lv_obj_set_style_border_side(struct _lv_obj_t * obj, lv_border_side_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BORDER_SIDE, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_SIDE, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_border_post(struct _lv_obj_t * obj, uint32_t part, uint32_t state, bool value)
|
||||
static inline void lv_obj_set_style_border_post(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_BORDER_POST, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_POST, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_text_color(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_text_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_TEXT_COLOR, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_COLOR, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_text_color_filtered(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_text_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_TEXT_COLOR_FILTERED, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_COLOR_FILTERED, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_text_opa(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_opa_t value)
|
||||
static inline void lv_obj_set_style_text_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_TEXT_OPA, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_OPA, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_text_font(struct _lv_obj_t * obj, uint32_t part, uint32_t state, const lv_font_t * value)
|
||||
static inline void lv_obj_set_style_text_font(struct _lv_obj_t * obj, const lv_font_t * value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.ptr = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_TEXT_FONT, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_FONT, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_text_letter_space(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_text_letter_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_TEXT_LETTER_SPACE, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_LETTER_SPACE, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_text_line_space(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_text_line_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_TEXT_LINE_SPACE, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_LINE_SPACE, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_text_decor(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_text_decor_t value)
|
||||
static inline void lv_obj_set_style_text_decor(struct _lv_obj_t * obj, lv_text_decor_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_TEXT_DECOR, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_DECOR, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_text_align(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_text_align_t value)
|
||||
static inline void lv_obj_set_style_text_align(struct _lv_obj_t * obj, lv_text_align_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_TEXT_ALIGN, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_ALIGN, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_img_opa(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_opa_t value)
|
||||
static inline void lv_obj_set_style_img_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_IMG_OPA, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_IMG_OPA, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_img_recolor(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_img_recolor(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_IMG_RECOLOR, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_IMG_RECOLOR, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_img_recolor_filtered(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_img_recolor_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_IMG_RECOLOR_FILTERED, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_IMG_RECOLOR_FILTERED, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_img_recolor_opa(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_opa_t value)
|
||||
static inline void lv_obj_set_style_img_recolor_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_IMG_RECOLOR_OPA, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_IMG_RECOLOR_OPA, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_outline_width(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_outline_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_OUTLINE_WIDTH, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_WIDTH, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_outline_color(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_outline_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_OUTLINE_COLOR, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_COLOR, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_outline_color_filtered(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_outline_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_OUTLINE_COLOR_FILTERED, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_COLOR_FILTERED, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_outline_opa(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_opa_t value)
|
||||
static inline void lv_obj_set_style_outline_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_OUTLINE_OPA, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_OPA, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_outline_pad(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_outline_pad(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_OUTLINE_PAD, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_PAD, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_shadow_width(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_shadow_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_SHADOW_WIDTH, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_WIDTH, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_shadow_ofs_x(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_shadow_ofs_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_SHADOW_OFS_X, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OFS_X, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_shadow_ofs_y(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_shadow_ofs_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_SHADOW_OFS_Y, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OFS_Y, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_shadow_spread(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_shadow_spread(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_SHADOW_SPREAD, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_SPREAD, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_shadow_color(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_shadow_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_SHADOW_COLOR, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_COLOR, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_shadow_color_filtered(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_shadow_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_SHADOW_COLOR_FILTERED, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_COLOR_FILTERED, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_shadow_opa(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_opa_t value)
|
||||
static inline void lv_obj_set_style_shadow_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_SHADOW_OPA, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OPA, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_line_width(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_line_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_LINE_WIDTH, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_WIDTH, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_line_dash_width(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_line_dash_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_LINE_DASH_WIDTH, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_DASH_WIDTH, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_line_dash_gap(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_line_dash_gap(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_LINE_DASH_GAP, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_DASH_GAP, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_line_rounded(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_line_rounded(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_LINE_ROUNDED, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_ROUNDED, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_line_color(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_line_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_LINE_COLOR, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_COLOR, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_line_color_filtered(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_line_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_LINE_COLOR_FILTERED, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_COLOR_FILTERED, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_line_opa(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_opa_t value)
|
||||
static inline void lv_obj_set_style_line_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_LINE_OPA, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_OPA, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_arc_width(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_arc_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_ARC_WIDTH, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_WIDTH, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_arc_rounded(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_arc_rounded(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_ARC_ROUNDED, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_ROUNDED, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_arc_color(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_arc_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_ARC_COLOR, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_COLOR, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_arc_color_filtered(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_color_t value)
|
||||
static inline void lv_obj_set_style_arc_color_filtered(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.color = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_ARC_COLOR_FILTERED, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_COLOR_FILTERED, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_arc_opa(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_opa_t value)
|
||||
static inline void lv_obj_set_style_arc_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_ARC_OPA, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_OPA, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_arc_img_src(struct _lv_obj_t * obj, uint32_t part, uint32_t state, const void * value)
|
||||
static inline void lv_obj_set_style_arc_img_src(struct _lv_obj_t * obj, const void * value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.ptr = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_ARC_IMG_SRC, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_IMG_SRC, v, selector);
|
||||
}
|
||||
|
||||
|
||||
@@ -346,7 +346,7 @@ static void obj_del_core(lv_obj_t * obj)
|
||||
|
||||
/*Remove all style*/
|
||||
lv_obj_enable_style_refresh(false); /*No need to refresh the style because the object will be deleted*/
|
||||
lv_obj_remove_style(obj, LV_PART_ANY, LV_STATE_ANY, NULL);
|
||||
lv_obj_remove_style_all(obj);
|
||||
lv_obj_enable_style_refresh(true);
|
||||
|
||||
/*Reset all input devices if the object to delete is used*/
|
||||
|
||||
@@ -240,14 +240,14 @@ void _lv_disp_refr_timer(lv_timer_t * tmr)
|
||||
static lv_obj_t * perf_label = NULL;
|
||||
if(perf_label == NULL) {
|
||||
perf_label = lv_label_create(lv_layer_sys());
|
||||
lv_obj_set_style_bg_opa(perf_label, LV_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_50);
|
||||
lv_obj_set_style_bg_color(perf_label, LV_PART_MAIN, LV_STATE_DEFAULT, lv_color_black());
|
||||
lv_obj_set_style_text_color(perf_label, LV_PART_MAIN, LV_STATE_DEFAULT, lv_color_white());
|
||||
lv_obj_set_style_pad_top(perf_label, LV_PART_MAIN, LV_STATE_DEFAULT, 3);
|
||||
lv_obj_set_style_pad_bottom(perf_label, LV_PART_MAIN, LV_STATE_DEFAULT, 3);
|
||||
lv_obj_set_style_pad_left(perf_label, LV_PART_MAIN, LV_STATE_DEFAULT, 3);
|
||||
lv_obj_set_style_pad_right(perf_label, LV_PART_MAIN, LV_STATE_DEFAULT, 3);
|
||||
lv_obj_set_style_text_align(perf_label, LV_PART_MAIN, LV_STATE_DEFAULT, LV_TEXT_ALIGN_RIGHT);
|
||||
lv_obj_set_style_bg_opa(perf_label, LV_OPA_50, 0);
|
||||
lv_obj_set_style_bg_color(perf_label, lv_color_black(), 0);
|
||||
lv_obj_set_style_text_color(perf_label, lv_color_white(), 0);
|
||||
lv_obj_set_style_pad_top(perf_label, 3, 0);
|
||||
lv_obj_set_style_pad_bottom(perf_label, 3, 0);
|
||||
lv_obj_set_style_pad_left(perf_label, 3, 0);
|
||||
lv_obj_set_style_pad_right(perf_label, 3, 0);
|
||||
lv_obj_set_style_text_align(perf_label, LV_TEXT_ALIGN_RIGHT, 0);
|
||||
lv_label_set_text(perf_label, "?");
|
||||
lv_obj_align(perf_label, LV_ALIGN_BOTTOM_RIGHT, 0, 0);
|
||||
}
|
||||
@@ -284,13 +284,13 @@ void _lv_disp_refr_timer(lv_timer_t * tmr)
|
||||
static lv_obj_t * mem_label = NULL;
|
||||
if(mem_label == NULL) {
|
||||
mem_label = lv_label_create(lv_layer_sys());
|
||||
lv_obj_set_style_bg_opa(mem_label, LV_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_50);
|
||||
lv_obj_set_style_bg_color(mem_label, LV_PART_MAIN, LV_STATE_DEFAULT, lv_color_black());
|
||||
lv_obj_set_style_text_color(mem_label, LV_PART_MAIN, LV_STATE_DEFAULT, lv_color_white());
|
||||
lv_obj_set_style_pad_top(mem_label, LV_PART_MAIN, LV_STATE_DEFAULT, 3);
|
||||
lv_obj_set_style_pad_bottom(mem_label, LV_PART_MAIN, LV_STATE_DEFAULT, 3);
|
||||
lv_obj_set_style_pad_left(mem_label, LV_PART_MAIN, LV_STATE_DEFAULT, 3);
|
||||
lv_obj_set_style_pad_right(mem_label, LV_PART_MAIN, LV_STATE_DEFAULT, 3);
|
||||
lv_obj_set_style_bg_opa(mem_label, LV_OPA_50, 0);
|
||||
lv_obj_set_style_bg_color(mem_label, lv_color_black(), 0);
|
||||
lv_obj_set_style_text_color(mem_label, lv_color_white(), 0);
|
||||
lv_obj_set_style_pad_top(mem_label, 3, 0);
|
||||
lv_obj_set_style_pad_bottom(mem_label, 3, 0);
|
||||
lv_obj_set_style_pad_left(mem_label, 3, 0);
|
||||
lv_obj_set_style_pad_right(mem_label, 3, 0);
|
||||
lv_label_set_text(mem_label, "?");
|
||||
lv_obj_align(mem_label, LV_ALIGN_BOTTOM_LEFT, 0, 0);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ void lv_theme_apply(lv_obj_t * obj)
|
||||
lv_theme_t * th = lv_theme_get_from_obj(obj);
|
||||
if(th == NULL) return;
|
||||
|
||||
lv_obj_remove_style(obj, LV_PART_ANY, LV_STATE_ANY, NULL);
|
||||
lv_obj_remove_style_all(obj);
|
||||
|
||||
apply_theme(th, obj); /*Apply the theme including the base theme(s)*/
|
||||
}
|
||||
|
||||
@@ -86,21 +86,21 @@ void lv_flex_init(void)
|
||||
|
||||
void lv_obj_set_flex_flow(lv_obj_t * obj, lv_flex_flow_t flow)
|
||||
{
|
||||
lv_obj_set_style_flex_flow(obj, LV_PART_MAIN, LV_STATE_DEFAULT, flow);
|
||||
lv_obj_set_style_layout(obj, LV_PART_MAIN, LV_STATE_DEFAULT, LV_LAYOUT_FLEX);
|
||||
lv_obj_set_style_flex_flow(obj, flow, 0);
|
||||
lv_obj_set_style_layout(obj, LV_LAYOUT_FLEX, 0);
|
||||
}
|
||||
|
||||
void lv_obj_set_flex_place(lv_obj_t * obj, lv_flex_place_t main_place, lv_flex_place_t cross_place, lv_flex_place_t track_place)
|
||||
{
|
||||
lv_obj_set_style_flex_main_place(obj, LV_PART_MAIN, LV_STATE_DEFAULT, main_place);
|
||||
lv_obj_set_style_flex_cross_place(obj, LV_PART_MAIN, LV_STATE_DEFAULT, cross_place);
|
||||
lv_obj_set_style_flex_track_place(obj, LV_PART_MAIN, LV_STATE_DEFAULT, track_place);
|
||||
lv_obj_set_style_layout(obj, LV_PART_MAIN, LV_STATE_DEFAULT, LV_LAYOUT_FLEX);
|
||||
lv_obj_set_style_flex_main_place(obj, main_place, 0);
|
||||
lv_obj_set_style_flex_cross_place(obj, cross_place, 0);
|
||||
lv_obj_set_style_flex_track_place(obj, track_place, 0);
|
||||
lv_obj_set_style_layout(obj, LV_LAYOUT_FLEX, 0);
|
||||
}
|
||||
|
||||
void lv_obj_set_flex_grow(struct _lv_obj_t * obj, uint8_t grow)
|
||||
{
|
||||
lv_obj_set_style_flex_grow(obj, LV_PART_MAIN, LV_STATE_DEFAULT, grow);
|
||||
lv_obj_set_style_flex_grow(obj, grow, 0);
|
||||
}
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -141,44 +141,44 @@ static inline void lv_style_set_flex_grow(lv_style_t * style, uint8_t value)
|
||||
|
||||
|
||||
|
||||
static inline void lv_obj_set_style_flex_flow(lv_obj_t * obj, lv_part_t part, lv_state_t state, lv_flex_flow_t value)
|
||||
static inline void lv_obj_set_style_flex_flow(lv_obj_t * obj, lv_flex_flow_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t) value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_FLEX_FLOW, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_FLOW, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_flex_main_place(lv_obj_t * obj, lv_part_t part, lv_state_t state, lv_flex_place_t value)
|
||||
static inline void lv_obj_set_style_flex_main_place(lv_obj_t * obj, lv_flex_place_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t) value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_FLEX_MAIN_PLACE, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_MAIN_PLACE, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_flex_cross_place(lv_obj_t * obj, lv_part_t part, lv_state_t state, lv_flex_place_t value)
|
||||
static inline void lv_obj_set_style_flex_cross_place(lv_obj_t * obj, lv_flex_place_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t) value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_FLEX_CROSS_PLACE, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_CROSS_PLACE, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_flex_track_place(lv_obj_t * obj, lv_part_t part, lv_state_t state, lv_flex_place_t value)
|
||||
static inline void lv_obj_set_style_flex_track_place(lv_obj_t * obj, lv_flex_place_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t) value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_FLEX_TRACK_PLACE, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_TRACK_PLACE, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_flex_grow(lv_obj_t * obj, lv_part_t part, lv_state_t state, uint8_t value)
|
||||
static inline void lv_obj_set_style_flex_grow(lv_obj_t * obj, uint8_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t) value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_FLEX_GROW, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_GROW, v, selector);
|
||||
}
|
||||
|
||||
static inline lv_flex_flow_t lv_obj_get_style_flex_flow(const lv_obj_t * obj, uint32_t part)
|
||||
|
||||
@@ -115,15 +115,15 @@ void lv_grid_init(void)
|
||||
|
||||
void lv_obj_set_grid_template(lv_obj_t * obj, const lv_coord_t * col_templ, const lv_coord_t * row_templ)
|
||||
{
|
||||
lv_obj_set_style_grid_column_template(obj, LV_PART_MAIN, LV_STATE_DEFAULT, col_templ);
|
||||
lv_obj_set_style_grid_row_template(obj, LV_PART_MAIN, LV_STATE_DEFAULT, row_templ);
|
||||
lv_obj_set_style_layout(obj, LV_PART_MAIN, LV_STATE_DEFAULT, LV_LAYOUT_GRID);
|
||||
lv_obj_set_style_grid_column_template(obj, col_templ, 0);
|
||||
lv_obj_set_style_grid_row_template(obj, row_templ, 0);
|
||||
lv_obj_set_style_layout(obj, LV_LAYOUT_GRID, 0);
|
||||
}
|
||||
|
||||
void lv_obj_set_grid_place(lv_obj_t * obj, lv_grid_place_t hor_place, lv_grid_place_t ver_place)
|
||||
{
|
||||
lv_obj_set_style_grid_column_place(obj, LV_PART_MAIN, LV_STATE_DEFAULT, hor_place);
|
||||
lv_obj_set_style_grid_row_place(obj, LV_PART_MAIN, LV_STATE_DEFAULT, ver_place);
|
||||
lv_obj_set_style_grid_column_place(obj, hor_place, 0);
|
||||
lv_obj_set_style_grid_row_place(obj, ver_place, 0);
|
||||
|
||||
}
|
||||
|
||||
@@ -131,12 +131,12 @@ void lv_obj_set_grid_cell(lv_obj_t * obj, lv_grid_place_t hor_place, uint8_t col
|
||||
lv_grid_place_t ver_place, uint8_t row_pos, uint8_t row_span)
|
||||
|
||||
{
|
||||
lv_obj_set_style_grid_cell_column_pos(obj, LV_PART_MAIN, LV_STATE_DEFAULT, col_pos);
|
||||
lv_obj_set_style_grid_cell_row_pos(obj, LV_PART_MAIN, LV_STATE_DEFAULT, row_pos);
|
||||
lv_obj_set_style_grid_cell_x_place(obj, LV_PART_MAIN, LV_STATE_DEFAULT, hor_place);
|
||||
lv_obj_set_style_grid_cell_column_span(obj, LV_PART_MAIN, LV_STATE_DEFAULT, col_span);
|
||||
lv_obj_set_style_grid_cell_row_span(obj, LV_PART_MAIN, LV_STATE_DEFAULT, row_span);
|
||||
lv_obj_set_style_grid_cell_y_place(obj, LV_PART_MAIN, LV_STATE_DEFAULT, ver_place);
|
||||
lv_obj_set_style_grid_cell_column_pos(obj, col_pos, 0);
|
||||
lv_obj_set_style_grid_cell_row_pos(obj, row_pos, 0);
|
||||
lv_obj_set_style_grid_cell_x_place(obj, hor_place, 0);
|
||||
lv_obj_set_style_grid_cell_column_span(obj, col_span, 0);
|
||||
lv_obj_set_style_grid_cell_row_span(obj, row_span, 0);
|
||||
lv_obj_set_style_grid_cell_y_place(obj, ver_place, 0);
|
||||
|
||||
lv_obj_mark_layout_as_dirty(lv_obj_get_parent(obj));
|
||||
}
|
||||
|
||||
@@ -173,86 +173,86 @@ static inline void lv_style_set_grid_cell_y_place(lv_style_t * style, lv_coord_t
|
||||
lv_style_set_prop(style, LV_STYLE_GRID_CELL_ROW_PLACE, v);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_grid_row_template(lv_obj_t * obj, lv_part_t part, lv_state_t state, const lv_coord_t * value)
|
||||
static inline void lv_obj_set_style_grid_row_template(lv_obj_t * obj, const lv_coord_t * value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.ptr = (const void *)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state,LV_STYLE_GRID_ROW_TEMPLATE, v);
|
||||
lv_obj_set_local_style_prop(obj,LV_STYLE_GRID_ROW_TEMPLATE, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_grid_column_template(lv_obj_t * obj, lv_part_t part, lv_state_t state, const lv_coord_t * value)
|
||||
static inline void lv_obj_set_style_grid_column_template(lv_obj_t * obj, const lv_coord_t * value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.ptr = (const void *)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_GRID_COL_TEMPLATE, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_COL_TEMPLATE, v, selector);
|
||||
}
|
||||
|
||||
|
||||
static inline void lv_obj_set_style_grid_row_place(lv_obj_t * obj, lv_part_t part, lv_state_t state, lv_grid_place_t value)
|
||||
static inline void lv_obj_set_style_grid_row_place(lv_obj_t * obj, lv_grid_place_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t) value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_GRID_ROW_PLACE, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_ROW_PLACE, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_grid_column_place(lv_obj_t * obj, lv_part_t part, lv_state_t state, lv_grid_place_t value)
|
||||
static inline void lv_obj_set_style_grid_column_place(lv_obj_t * obj, lv_grid_place_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t) value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_GRID_COL_PLACE, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_COL_PLACE, v, selector);
|
||||
}
|
||||
|
||||
|
||||
static inline void lv_obj_set_style_grid_cell_column_pos(lv_obj_t * obj, lv_part_t part, lv_state_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_grid_cell_column_pos(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state,LV_STYLE_GRID_CELL_COL_POS, v);
|
||||
lv_obj_set_local_style_prop(obj,LV_STYLE_GRID_CELL_COL_POS, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_grid_cell_column_span(lv_obj_t * obj, lv_part_t part, lv_state_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_grid_cell_column_span(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state,LV_STYLE_GRID_CELL_COL_SPAN, v);
|
||||
lv_obj_set_local_style_prop(obj,LV_STYLE_GRID_CELL_COL_SPAN, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_grid_cell_row_pos(lv_obj_t * obj, lv_part_t part, lv_state_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_grid_cell_row_pos(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state,LV_STYLE_GRID_CELL_ROW_POS, v);
|
||||
lv_obj_set_local_style_prop(obj,LV_STYLE_GRID_CELL_ROW_POS, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_grid_cell_row_span(lv_obj_t * obj, lv_part_t part, lv_state_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_grid_cell_row_span(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_GRID_CELL_ROW_SPAN, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_ROW_SPAN, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_grid_cell_x_place(lv_obj_t * obj, lv_part_t part, lv_state_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_grid_cell_x_place(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_GRID_CELL_COL_PLACE, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_COL_PLACE, v, selector);
|
||||
}
|
||||
|
||||
static inline void lv_obj_set_style_grid_cell_y_place(lv_obj_t * obj, lv_part_t part, lv_state_t state, lv_coord_t value)
|
||||
static inline void lv_obj_set_style_grid_cell_y_place(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, part, state, LV_STYLE_GRID_CELL_ROW_PLACE, v);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_ROW_PLACE, v, selector);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -173,8 +173,8 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
|
||||
LV_UNUSED(th);
|
||||
|
||||
if(lv_obj_get_parent(obj) == NULL) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->scr);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, &styles->scr, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -183,13 +183,13 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
|
||||
lv_obj_t * parent = lv_obj_get_parent(obj);
|
||||
/*Tabview content area*/
|
||||
if(lv_obj_check_type(parent, &lv_tabview_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
return;
|
||||
}
|
||||
/*Tabview pages*/
|
||||
else if(lv_obj_check_type(lv_obj_get_parent(parent), &lv_tabview_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -197,24 +197,24 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
|
||||
#if LV_USE_WIN
|
||||
/*Header*/
|
||||
if(lv_obj_get_child_id(obj) == 0 && lv_obj_check_type(lv_obj_get_parent(obj), &lv_win_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
return;
|
||||
}
|
||||
/*Content*/
|
||||
else if(lv_obj_get_child_id(obj) == 1 && lv_obj_check_type(lv_obj_get_parent(obj), &lv_win_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
}
|
||||
#if LV_USE_BTN
|
||||
else if(lv_obj_check_type(obj, &lv_btn_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->dark);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DISABLED, &styles->disabled);
|
||||
lv_obj_add_style(obj, &styles->dark, 0);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_STATE_PRESSED);
|
||||
lv_obj_add_style(obj, &styles->disabled, LV_STATE_DISABLED);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -222,185 +222,186 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
|
||||
else if(lv_obj_check_type(obj, &lv_btnmatrix_class)) {
|
||||
#if LV_USE_MSGBOX
|
||||
if(lv_obj_check_type(lv_obj_get_parent(obj), &lv_msgbox_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, &styles->light, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if LV_USE_TABVIEW
|
||||
if(lv_obj_check_type(lv_obj_get_parent(obj), &lv_tabview_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, &styles->light, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->dark);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->dark, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_BAR
|
||||
else if(lv_obj_check_type(obj, &lv_bar_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_zero);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->dark);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->pad_zero, 0);
|
||||
lv_obj_add_style(obj, &styles->dark, LV_PART_INDICATOR);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_SLIDER
|
||||
else if(lv_obj_check_type(obj, &lv_slider_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_zero);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->dark);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->pad_zero, 0);
|
||||
lv_obj_add_style(obj, &styles->dark, LV_PART_INDICATOR);
|
||||
lv_obj_add_style(obj, &styles->dark, LV_PART_KNOB);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_TABLE
|
||||
else if(lv_obj_check_type(obj, &lv_table_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
lv_obj_add_style(obj, &styles->light, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_CHECKBOX
|
||||
else if(lv_obj_check_type(obj, &lv_checkbox_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DISABLED, &styles->disabled);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_CHECKED, &styles->dark);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, &styles->light, LV_PART_INDICATOR);
|
||||
lv_obj_add_style(obj, &styles->disabled, LV_PART_INDICATOR | LV_STATE_DISABLED);
|
||||
lv_obj_add_style(obj, &styles->dark, LV_PART_INDICATOR | LV_STATE_CHECKED);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_INDICATOR | LV_STATE_PRESSED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_SWITCH
|
||||
else if(lv_obj_check_type(obj, &lv_switch_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_zero);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->dark);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->dark);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->pad_zero);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->pad_zero, 0);
|
||||
lv_obj_add_style(obj, &styles->dark, LV_PART_INDICATOR);
|
||||
lv_obj_add_style(obj, &styles->dark, LV_PART_KNOB);
|
||||
lv_obj_add_style(obj, &styles->pad_zero, LV_PART_KNOB);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_CHART
|
||||
else if(lv_obj_check_type(obj, &lv_chart_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_TICKS, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_CURSOR, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
lv_obj_add_style(obj, &styles->light, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->light, LV_PART_TICKS);
|
||||
lv_obj_add_style(obj, &styles->light, LV_PART_CURSOR);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_ROLLER
|
||||
else if(lv_obj_check_type(obj, &lv_roller_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_SELECTED, LV_STATE_DEFAULT, &styles->dark);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->dark, LV_PART_SELECTED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_DROPDOWN
|
||||
else if(lv_obj_check_type(obj, &lv_dropdown_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_STATE_PRESSED);
|
||||
}
|
||||
else if(lv_obj_check_type(obj, &lv_dropdownlist_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, LV_PART_SELECTED, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_SELECTED, LV_STATE_CHECKED, &styles->dark);
|
||||
lv_obj_add_style(obj, LV_PART_SELECTED, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
lv_obj_add_style(obj, &styles->light, LV_PART_SELECTED);
|
||||
lv_obj_add_style(obj, &styles->dark, LV_PART_SELECTED | LV_STATE_CHECKED);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_SELECTED | LV_STATE_PRESSED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_ARC
|
||||
else if(lv_obj_check_type(obj, &lv_arc_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->dark);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->pad_zero);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->dark);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->dark, LV_PART_INDICATOR);
|
||||
lv_obj_add_style(obj, &styles->pad_zero, LV_PART_INDICATOR);
|
||||
lv_obj_add_style(obj, &styles->dark, LV_PART_KNOB);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_METER
|
||||
else if(lv_obj_check_type(obj, &lv_meter_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_TEXTAREA
|
||||
else if(lv_obj_check_type(obj, &lv_textarea_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, LV_PART_CURSOR, LV_STATE_FOCUSED, &styles->dark);
|
||||
lv_obj_add_style(obj, LV_PART_TEXTAREA_PLACEHOLDER, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
lv_obj_add_style(obj, &styles->dark, LV_PART_CURSOR);
|
||||
lv_obj_add_style(obj, &styles->light, LV_PART_TEXTAREA_PLACEHOLDER);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_CALENDAR
|
||||
else if(lv_obj_check_type(obj, &lv_calendar_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DISABLED, &styles->disabled);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->light, LV_PART_ITEMS | LV_STATE_PRESSED);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
|
||||
lv_obj_add_style(obj, &styles->disabled, LV_PART_ITEMS | LV_STATE_DISABLED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_KEYBOARD
|
||||
else if(lv_obj_check_type(obj, &lv_keyboard_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->light, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
|
||||
}
|
||||
#endif
|
||||
#if LV_USE_LIST
|
||||
else if(lv_obj_check_type(obj, &lv_list_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
return;
|
||||
}
|
||||
else if(lv_obj_check_type(obj, &lv_list_text_class)) {
|
||||
|
||||
}
|
||||
else if(lv_obj_check_type(obj, &lv_list_btn_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->dark);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, &styles->dark, 0);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_STATE_PRESSED);
|
||||
|
||||
}
|
||||
#endif
|
||||
#if LV_USE_MSGBOX
|
||||
else if(lv_obj_check_type(obj, &lv_msgbox_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if LV_USE_SPINBOX
|
||||
else if(lv_obj_check_type(obj, &lv_spinbox_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_CURSOR, LV_STATE_FOCUSED, &styles->dark);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->dark, LV_PART_CURSOR);
|
||||
}
|
||||
#endif
|
||||
#if LV_USE_TILEVIEW
|
||||
else if(lv_obj_check_type(obj, &lv_tileview_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->scr);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, &styles->scr, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
}
|
||||
else if(lv_obj_check_type(obj, &lv_tileview_tile_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_COLORWHEEL
|
||||
else if(lv_obj_check_type(obj, &lv_colorwheel_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
lv_obj_add_style(obj, &styles->light, LV_PART_KNOB);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_LED
|
||||
else if(lv_obj_check_type(obj, &lv_led_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->light);
|
||||
lv_obj_add_style(obj, &styles->light, 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -571,9 +571,9 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
|
||||
LV_UNUSED(th);
|
||||
|
||||
if(lv_obj_get_parent(obj) == NULL) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->scr);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_SCROLLED, &styles->scrollbar_scrolled);
|
||||
lv_obj_add_style(obj, &styles->scr, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -582,16 +582,16 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
|
||||
lv_obj_t * parent = lv_obj_get_parent(obj);
|
||||
/*Tabview content area*/
|
||||
if(lv_obj_check_type(parent, &lv_tabview_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_grey);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_gap);
|
||||
lv_obj_add_style(obj, &styles->bg_color_grey, 0);
|
||||
lv_obj_add_style(obj, &styles->pad_gap, 0);
|
||||
return;
|
||||
}
|
||||
/*Tabview pages*/
|
||||
else if(lv_obj_check_type(lv_obj_get_parent(parent), &lv_tabview_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->scr);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_normal);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_SCROLLED, &styles->scrollbar_scrolled);
|
||||
lv_obj_add_style(obj, &styles->scr, 0);
|
||||
lv_obj_add_style(obj, &styles->pad_normal, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -599,35 +599,41 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
|
||||
#if LV_USE_WIN
|
||||
/*Header*/
|
||||
if(lv_obj_get_child_id(obj) == 0 && lv_obj_check_type(lv_obj_get_parent(obj), &lv_win_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_grey);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_tiny);
|
||||
lv_obj_add_style(obj, &styles->bg_color_grey, 0);
|
||||
lv_obj_add_style(obj, &styles->pad_tiny, 0);
|
||||
return;
|
||||
}
|
||||
/*Content*/
|
||||
else if(lv_obj_get_child_id(obj) == 1 && lv_obj_check_type(lv_obj_get_parent(obj), &lv_win_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->scr);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_normal);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_SCROLLED, &styles->scrollbar_scrolled);
|
||||
lv_obj_add_style(obj, &styles->scr, 0);
|
||||
lv_obj_add_style(obj, &styles->pad_normal, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_SCROLLED, &styles->scrollbar_scrolled);
|
||||
lv_obj_add_style(obj, &styles->card, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
|
||||
}
|
||||
#if LV_USE_BTN
|
||||
else if(lv_obj_check_type(obj, &lv_btn_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->btn);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_primary);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->transition_delayed);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_PRESSED, &styles->transition_normal);
|
||||
lv_obj_add_style(obj, &styles->btn, 0);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary, 0);
|
||||
lv_obj_add_style(obj, &styles->transition_delayed, 0);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_STATE_PRESSED);
|
||||
lv_obj_add_style(obj, &styles->transition_normal, LV_STATE_PRESSED);
|
||||
#if LV_THEME_DEFAULT_GROW
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_PRESSED, &styles->grow);
|
||||
lv_obj_add_style(obj, &styles->grow, LV_STATE_PRESSED);
|
||||
#endif
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_CHECKED, &styles->bg_color_secondary);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DISABLED, &styles->disabled);
|
||||
lv_obj_add_style(obj, &styles->bg_color_secondary, LV_STATE_CHECKED);
|
||||
lv_obj_add_style(obj, &styles->disabled, LV_STATE_DISABLED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_LINE
|
||||
else if(lv_obj_check_type(obj, &lv_line_class)) {
|
||||
lv_obj_add_style(obj, &styles->card, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -635,285 +641,282 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
|
||||
else if(lv_obj_check_type(obj, &lv_btnmatrix_class)) {
|
||||
#if LV_USE_MSGBOX
|
||||
if(lv_obj_check_type(lv_obj_get_parent(obj), &lv_msgbox_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->msgbox_btns_bg);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_gap);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->btn);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_CHECKED, &styles->bg_color_primary);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_CHECKED, &styles->bg_color_primary);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, &styles->msgbox_btns_bg, 0);
|
||||
lv_obj_add_style(obj, &styles->pad_gap, 0);
|
||||
lv_obj_add_style(obj, &styles->btn, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_ITEMS | LV_STATE_CHECKED);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if LV_USE_TABVIEW
|
||||
if(lv_obj_check_type(lv_obj_get_parent(obj), &lv_tabview_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_white);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->bg_color_white);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_CHECKED, &styles->bg_color_primary_muted);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_CHECKED, &styles->tab_btn);
|
||||
lv_obj_add_style(obj, &styles->bg_color_white, 0);
|
||||
lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary_muted, LV_PART_ITEMS | LV_STATE_CHECKED);
|
||||
lv_obj_add_style(obj, &styles->tab_btn, LV_PART_ITEMS | LV_STATE_CHECKED);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->btn);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_CHECKED, &styles->bg_color_primary);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_EDITED, &styles->outline_secondary);
|
||||
lv_obj_add_style(obj, &styles->card, 0);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED);
|
||||
lv_obj_add_style(obj, &styles->btn, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_ITEMS | LV_STATE_CHECKED);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->outline_secondary, LV_PART_ITEMS | LV_STATE_EDITED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_BAR
|
||||
else if(lv_obj_check_type(obj, &lv_bar_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_primary_muted);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->circle);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->bg_color_primary);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->circle);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary_muted, 0);
|
||||
lv_obj_add_style(obj, &styles->circle, 0);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_INDICATOR);
|
||||
lv_obj_add_style(obj, &styles->circle, LV_PART_INDICATOR);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_SLIDER
|
||||
else if(lv_obj_check_type(obj, &lv_slider_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_primary_muted);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->circle);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->bg_color_primary);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->circle);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->knob);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary_muted, 0);
|
||||
lv_obj_add_style(obj, &styles->circle, 0);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_INDICATOR);
|
||||
lv_obj_add_style(obj, &styles->circle, LV_PART_INDICATOR);
|
||||
lv_obj_add_style(obj, &styles->knob, LV_PART_KNOB);
|
||||
#if LV_THEME_DEFAULT_GROW
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_PRESSED, &styles->grow);
|
||||
lv_obj_add_style(obj, &styles->grow, LV_PART_KNOB | LV_STATE_PRESSED);
|
||||
#endif
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->transition_delayed);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_PRESSED, &styles->transition_normal);
|
||||
lv_obj_add_style(obj, &styles->transition_delayed, LV_PART_KNOB);
|
||||
lv_obj_add_style(obj, &styles->transition_normal, LV_PART_KNOB | LV_STATE_PRESSED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_TABLE
|
||||
else if(lv_obj_check_type(obj, &lv_table_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_zero);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->no_radius);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_SCROLLED, &styles->scrollbar_scrolled);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->bg_color_white);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->table_cell);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->pad_normal);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_FOCUS_KEY, &styles->bg_color_primary);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_EDITED, &styles->bg_color_secondary);
|
||||
lv_obj_add_style(obj, &styles->card, 0);
|
||||
lv_obj_add_style(obj, &styles->pad_zero, 0);
|
||||
lv_obj_add_style(obj, &styles->no_radius, 0);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
|
||||
lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->table_cell, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->pad_normal, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->bg_color_secondary, LV_PART_ITEMS | LV_STATE_EDITED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_CHECKBOX
|
||||
else if(lv_obj_check_type(obj, &lv_checkbox_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_gap);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->cb_bg_outline_pad);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DISABLED, &styles->disabled);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->cb_marker);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_CHECKED, &styles->bg_color_primary);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_CHECKED, &styles->cb_marker_checked);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, &styles->pad_gap, 0);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->cb_bg_outline_pad, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->disabled, LV_PART_INDICATOR | LV_STATE_DISABLED);
|
||||
lv_obj_add_style(obj, &styles->cb_marker, LV_PART_INDICATOR);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_INDICATOR | LV_STATE_CHECKED);
|
||||
lv_obj_add_style(obj, &styles->cb_marker_checked, LV_PART_INDICATOR | LV_STATE_CHECKED);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_INDICATOR | LV_STATE_PRESSED);
|
||||
#if LV_THEME_DEFAULT_GROW
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_PRESSED, &styles->grow);
|
||||
lv_obj_add_style(obj, &styles->grow, LV_PART_INDICATOR | LV_STATE_PRESSED);
|
||||
#endif
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_PRESSED, &styles->transition_normal);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->transition_delayed);
|
||||
lv_obj_add_style(obj, &styles->transition_normal, LV_PART_INDICATOR | LV_STATE_PRESSED);
|
||||
lv_obj_add_style(obj, &styles->transition_delayed, LV_PART_INDICATOR);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_SWITCH
|
||||
else if(lv_obj_check_type(obj, &lv_switch_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_grey);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->circle);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DISABLED, &styles->disabled);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->bg_color_primary);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->circle);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DISABLED, &styles->disabled);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->knob);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->bg_color_white);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->switch_knob);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DISABLED, &styles->disabled);
|
||||
lv_obj_add_style(obj, &styles->bg_color_grey, 0);
|
||||
lv_obj_add_style(obj, &styles->circle, 0);
|
||||
lv_obj_add_style(obj, &styles->disabled, LV_STATE_DISABLED);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_INDICATOR);
|
||||
lv_obj_add_style(obj, &styles->circle, LV_PART_INDICATOR);
|
||||
lv_obj_add_style(obj, &styles->disabled, LV_PART_INDICATOR | LV_STATE_DISABLED);
|
||||
lv_obj_add_style(obj, &styles->knob, LV_PART_KNOB);
|
||||
lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_KNOB);
|
||||
lv_obj_add_style(obj, &styles->switch_knob, LV_PART_KNOB);
|
||||
lv_obj_add_style(obj, &styles->disabled, LV_PART_KNOB | LV_STATE_DISABLED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_CHART
|
||||
else if(lv_obj_check_type(obj, &lv_chart_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_small);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->chart_bg);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_SCROLLED, &styles->scrollbar_scrolled);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->chart_series);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->bg_color_primary);
|
||||
lv_obj_add_style(obj, LV_PART_TICKS, LV_STATE_DEFAULT, &styles->chart_ticks);
|
||||
lv_obj_add_style(obj, LV_PART_CURSOR, LV_STATE_DEFAULT, &styles->chart_series);
|
||||
lv_obj_add_style(obj, &styles->card, 0);
|
||||
lv_obj_add_style(obj, &styles->pad_small, 0);
|
||||
lv_obj_add_style(obj, &styles->chart_bg, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
|
||||
lv_obj_add_style(obj, &styles->chart_series, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_ITEMS | LV_STATE_PRESSED);
|
||||
lv_obj_add_style(obj, &styles->chart_ticks, LV_PART_TICKS);
|
||||
lv_obj_add_style(obj, &styles->chart_series, LV_PART_CURSOR);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_ROLLER
|
||||
else if(lv_obj_check_type(obj, &lv_roller_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->anim);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->line_space_large);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->text_align_center);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
|
||||
lv_obj_add_style(obj, LV_PART_SELECTED, LV_STATE_DEFAULT, &styles->bg_color_primary);
|
||||
lv_obj_add_style(obj, &styles->card, 0);
|
||||
lv_obj_add_style(obj, &styles->anim, 0);
|
||||
lv_obj_add_style(obj, &styles->line_space_large, 0);
|
||||
lv_obj_add_style(obj, &styles->text_align_center, 0);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_SELECTED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_DROPDOWN
|
||||
else if(lv_obj_check_type(obj, &lv_dropdown_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_small);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->transition_delayed);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_PRESSED, &styles->transition_normal);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->transition_normal);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
|
||||
lv_obj_add_style(obj, &styles->card, 0);
|
||||
lv_obj_add_style(obj, &styles->pad_small, 0);
|
||||
lv_obj_add_style(obj, &styles->transition_delayed, 0);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_STATE_PRESSED);
|
||||
lv_obj_add_style(obj, &styles->transition_normal, LV_STATE_PRESSED);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED);
|
||||
}
|
||||
else if(lv_obj_check_type(obj, &lv_dropdownlist_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->line_space_large);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_SCROLLED, &styles->scrollbar_scrolled);
|
||||
lv_obj_add_style(obj, LV_PART_SELECTED, LV_STATE_DEFAULT, &styles->bg_color_white);
|
||||
lv_obj_add_style(obj, LV_PART_SELECTED, LV_STATE_CHECKED, &styles->bg_color_primary);
|
||||
lv_obj_add_style(obj, LV_PART_SELECTED, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, &styles->card, 0);
|
||||
lv_obj_add_style(obj, &styles->line_space_large, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
|
||||
lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_SELECTED);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_SELECTED | LV_STATE_CHECKED);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_SELECTED | LV_STATE_PRESSED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_ARC
|
||||
else if(lv_obj_check_type(obj, &lv_arc_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->arc_indic);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->arc_indic);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->arc_indic_primary);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->knob);
|
||||
lv_obj_add_style(obj, &styles->arc_indic, 0);
|
||||
lv_obj_add_style(obj, &styles->arc_indic, LV_PART_INDICATOR);
|
||||
lv_obj_add_style(obj, &styles->arc_indic_primary, LV_PART_INDICATOR);
|
||||
lv_obj_add_style(obj, &styles->knob, LV_PART_KNOB);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_METER
|
||||
else if(lv_obj_check_type(obj, &lv_meter_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->circle);
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DEFAULT, &styles->meter_indic);
|
||||
lv_obj_add_style(obj, &styles->card, 0);
|
||||
lv_obj_add_style(obj, &styles->circle, 0);
|
||||
lv_obj_add_style(obj, &styles->meter_indic, LV_PART_INDICATOR);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_TEXTAREA
|
||||
else if(lv_obj_check_type(obj, &lv_textarea_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_small);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_SCROLLED, &styles->scrollbar_scrolled);
|
||||
lv_obj_add_style(obj, LV_PART_CURSOR, LV_STATE_FOCUSED, &styles->ta_cursor);
|
||||
lv_obj_add_style(obj, LV_PART_TEXTAREA_PLACEHOLDER, LV_STATE_DEFAULT, &styles->ta_placeholder);
|
||||
lv_obj_add_style(obj, &styles->card, 0);
|
||||
lv_obj_add_style(obj, &styles->pad_small, 0);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
|
||||
lv_obj_add_style(obj, &styles->ta_cursor, LV_PART_CURSOR | LV_STATE_FOCUSED);
|
||||
lv_obj_add_style(obj, &styles->ta_placeholder, LV_PART_TEXTAREA_PLACEHOLDER);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_CALENDAR
|
||||
else if(lv_obj_check_type(obj, &lv_calendar_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->calendar_bg);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->calendar_day);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DISABLED, &styles->disabled);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_EDITED, &styles->outline_secondary);
|
||||
lv_obj_add_style(obj, &styles->card, 0);
|
||||
lv_obj_add_style(obj, &styles->calendar_bg, 0);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED);
|
||||
lv_obj_add_style(obj, &styles->calendar_day, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
|
||||
lv_obj_add_style(obj, &styles->disabled, LV_PART_ITEMS | LV_STATE_DISABLED);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->outline_secondary, LV_PART_ITEMS | LV_STATE_EDITED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_KEYBOARD
|
||||
else if(lv_obj_check_type(obj, &lv_keyboard_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->scr);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, disp_size == DISP_LARGE ? &styles->pad_small : &styles->pad_tiny);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->btn);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->bg_color_white);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->keyboard_btn_bg);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_CHECKED, &styles->bg_color_grey);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_FOCUSED, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, &styles->scr, 0);
|
||||
lv_obj_add_style(obj, disp_size == DISP_LARGE ? &styles->pad_small : &styles->pad_tiny, 0);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED);
|
||||
lv_obj_add_style(obj, &styles->btn, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->keyboard_btn_bg, LV_PART_ITEMS);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
|
||||
lv_obj_add_style(obj, &styles->bg_color_grey, LV_PART_ITEMS | LV_STATE_CHECKED);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_PART_ITEMS | LV_STATE_FOCUSED);
|
||||
}
|
||||
#endif
|
||||
#if LV_USE_LIST
|
||||
else if(lv_obj_check_type(obj, &lv_list_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->list_bg);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_SCROLLED, &styles->scrollbar_scrolled);
|
||||
lv_obj_add_style(obj, &styles->card, 0);
|
||||
lv_obj_add_style(obj, &styles->list_bg, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
|
||||
return;
|
||||
}
|
||||
else if(lv_obj_check_type(obj, &lv_list_text_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_grey);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->list_item_grow);
|
||||
lv_obj_add_style(obj, &styles->bg_color_grey, 0);
|
||||
lv_obj_add_style(obj, &styles->list_item_grow, 0);
|
||||
}
|
||||
else if(lv_obj_check_type(obj, &lv_list_btn_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->bg_color_white);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->list_btn);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->bg_color_primary);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->list_item_grow);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_PRESSED, &styles->list_item_grow);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_PRESSED, &styles->pressed);
|
||||
lv_obj_add_style(obj, &styles->bg_color_white, 0);
|
||||
lv_obj_add_style(obj, &styles->list_btn, 0);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->list_item_grow, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->list_item_grow, LV_STATE_PRESSED);
|
||||
lv_obj_add_style(obj, &styles->pressed, LV_STATE_PRESSED);
|
||||
|
||||
}
|
||||
#endif
|
||||
#if LV_USE_MSGBOX
|
||||
else if(lv_obj_check_type(obj, &lv_msgbox_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
|
||||
lv_obj_add_style(obj, &styles->card, 0);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if LV_USE_SPINBOX
|
||||
else if(lv_obj_check_type(obj, &lv_spinbox_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_small);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
|
||||
lv_obj_add_style(obj, LV_PART_CURSOR, LV_STATE_FOCUSED, &styles->bg_color_primary);
|
||||
lv_obj_add_style(obj, &styles->card, 0);
|
||||
lv_obj_add_style(obj, &styles->pad_small, 0);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_CURSOR | LV_STATE_FOCUSED);
|
||||
}
|
||||
#endif
|
||||
#if LV_USE_TILEVIEW
|
||||
else if(lv_obj_check_type(obj, &lv_tileview_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->scr);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_SCROLLED, &styles->scrollbar_scrolled);
|
||||
lv_obj_add_style(obj, &styles->scr, 0);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
|
||||
}
|
||||
else if(lv_obj_check_type(obj, &lv_tileview_tile_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_DEFAULT, &styles->scrollbar);
|
||||
lv_obj_add_style(obj, LV_PART_SCROLLBAR, LV_STATE_SCROLLED, &styles->scrollbar_scrolled);
|
||||
lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR);
|
||||
lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_COLORWHEEL
|
||||
else if(lv_obj_check_type(obj, &lv_colorwheel_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->colorwheel_main);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->pad_normal);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->bg_color_white);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->pad_normal);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->bg_color_white);
|
||||
lv_obj_add_style(obj, &styles->colorwheel_main, 0);
|
||||
lv_obj_add_style(obj, &styles->pad_normal, 0);
|
||||
lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_KNOB);
|
||||
lv_obj_add_style(obj, &styles->pad_normal, LV_PART_KNOB);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_LED
|
||||
else if(lv_obj_check_type(obj, &lv_led_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->led);
|
||||
lv_obj_add_style(obj, &styles->led, 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -45,12 +45,12 @@ lv_obj_t * lv_calendar_header_arrow_create(lv_obj_t * parent, lv_obj_t * calenda
|
||||
lv_obj_t * header = lv_obj_create(parent);
|
||||
|
||||
/*Use the same paddings as the calendar*/
|
||||
lv_obj_set_style_pad_left(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_pad_left(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_pad_right(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_pad_right(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_pad_top(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_pad_top(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_pad_bottom(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_pad_bottom(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_pad_column(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_pad_column(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_radius(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_radius(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_pad_left(header, lv_obj_get_style_pad_left(calendar, LV_PART_MAIN), 0);
|
||||
lv_obj_set_style_pad_right(header, lv_obj_get_style_pad_right(calendar, LV_PART_MAIN), 0);
|
||||
lv_obj_set_style_pad_top(header, lv_obj_get_style_pad_top(calendar, LV_PART_MAIN), 0);
|
||||
lv_obj_set_style_pad_bottom(header, lv_obj_get_style_pad_bottom(calendar, LV_PART_MAIN), 0);
|
||||
lv_obj_set_style_pad_column(header, lv_obj_get_style_pad_column(calendar, LV_PART_MAIN), 0);
|
||||
lv_obj_set_style_radius(header, lv_obj_get_style_radius(calendar, LV_PART_MAIN), 0);
|
||||
|
||||
const lv_calendar_date_t * cur_date = lv_calendar_get_showed_date(calendar);
|
||||
|
||||
@@ -60,19 +60,19 @@ lv_obj_t * lv_calendar_header_arrow_create(lv_obj_t * parent, lv_obj_t * calenda
|
||||
lv_obj_set_flex_place(header, LV_FLEX_PLACE_START, LV_FLEX_PLACE_CENTER, LV_FLEX_PLACE_START);
|
||||
|
||||
lv_obj_t * mo_prev = lv_btn_create(header);
|
||||
lv_obj_set_style_bg_img_src(mo_prev, LV_PART_MAIN, LV_STATE_DEFAULT, LV_SYMBOL_LEFT);
|
||||
lv_obj_set_style_bg_img_src(mo_prev, LV_SYMBOL_LEFT, 0);
|
||||
lv_obj_set_size(mo_prev, btn_size, btn_size);
|
||||
lv_obj_add_event_cb(mo_prev, month_event_cb, calendar);
|
||||
lv_obj_clear_flag(mo_prev, LV_OBJ_FLAG_CLICK_FOCUSABLE);
|
||||
|
||||
lv_obj_t * label = lv_label_create(header);
|
||||
lv_label_set_long_mode(label, LV_LABEL_LONG_SCROLL_CIRCULAR);
|
||||
lv_obj_set_style_text_align(label, LV_PART_MAIN, LV_STATE_DEFAULT, LV_TEXT_ALIGN_CENTER);
|
||||
lv_obj_set_style_text_align(label, LV_TEXT_ALIGN_CENTER, 0);
|
||||
lv_obj_set_flex_grow(label, 1);
|
||||
lv_label_set_text_fmt(label, "%d %s", cur_date->year, month_names_def[cur_date->month - 1]);
|
||||
|
||||
lv_obj_t * mo_next = lv_btn_create(header);
|
||||
lv_obj_set_style_bg_img_src(mo_next, LV_PART_MAIN, LV_STATE_DEFAULT, LV_SYMBOL_RIGHT);
|
||||
lv_obj_set_style_bg_img_src(mo_next, LV_SYMBOL_RIGHT, 0);
|
||||
lv_obj_set_size(mo_next, btn_size, btn_size);
|
||||
lv_obj_add_event_cb(mo_next, month_event_cb, calendar);
|
||||
lv_obj_clear_flag(mo_next, LV_OBJ_FLAG_CLICK_FOCUSABLE);
|
||||
|
||||
@@ -54,12 +54,12 @@ lv_obj_t * lv_calendar_header_dropdown_create(lv_obj_t * parent, lv_obj_t * cale
|
||||
lv_obj_t * header = lv_obj_create(parent);
|
||||
|
||||
/*Use the same paddings as the calendar*/
|
||||
lv_obj_set_style_pad_left(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_pad_left(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_pad_right(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_pad_right(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_pad_top(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_pad_top(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_pad_bottom(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_pad_bottom(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_pad_column(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_pad_column(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_radius(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_radius(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_pad_left(header,lv_obj_get_style_pad_left(calendar, LV_PART_MAIN), 0);
|
||||
lv_obj_set_style_pad_right(header,lv_obj_get_style_pad_right(calendar, LV_PART_MAIN), 0);
|
||||
lv_obj_set_style_pad_top(header,lv_obj_get_style_pad_top(calendar, LV_PART_MAIN), 0);
|
||||
lv_obj_set_style_pad_bottom(header,lv_obj_get_style_pad_bottom(calendar, LV_PART_MAIN), 0);
|
||||
lv_obj_set_style_pad_column(header,lv_obj_get_style_pad_column(calendar, LV_PART_MAIN), 0);
|
||||
lv_obj_set_style_radius(header,lv_obj_get_style_radius(calendar, LV_PART_MAIN), 0);
|
||||
|
||||
const lv_calendar_date_t * cur_date = lv_calendar_get_showed_date(calendar);
|
||||
|
||||
|
||||
@@ -46,9 +46,9 @@ lv_obj_t * lv_msgbox_create(const char * title, const char * txt, const char * b
|
||||
lv_obj_t * parent = lv_obj_create(lv_layer_top());
|
||||
lv_obj_set_size(parent, LV_SIZE_PCT(100), LV_SIZE_PCT(100));
|
||||
|
||||
lv_obj_remove_style(parent, LV_PART_ANY, LV_STATE_ANY, NULL);
|
||||
lv_obj_set_style_bg_color(parent, LV_PART_MAIN, LV_STATE_DEFAULT, lv_color_grey());
|
||||
lv_obj_set_style_bg_opa(parent, LV_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_50);
|
||||
lv_obj_remove_style_all(parent);
|
||||
lv_obj_set_style_bg_color(parent, lv_color_grey(), 0);
|
||||
lv_obj_set_style_bg_opa(parent, LV_OPA_50, 0);
|
||||
|
||||
lv_obj_t * mbox = lv_obj_create_from_class(&lv_msgbox_class, parent);
|
||||
LV_ASSERT_MALLOC(mbox);
|
||||
|
||||
@@ -49,7 +49,7 @@ lv_obj_t * lv_spinner_create(lv_obj_t * parent, uint32_t time, uint32_t arc_leng
|
||||
|
||||
lv_obj_set_size(spinner, LV_DPI_DEF, LV_DPI_DEF);
|
||||
|
||||
lv_obj_remove_style(spinner, LV_PART_KNOB, LV_STATE_ANY, NULL);
|
||||
lv_obj_remove_style(spinner, NULL, LV_PART_KNOB | LV_STATE_ANY);
|
||||
|
||||
lv_anim_path_t path;
|
||||
lv_anim_path_init(&path);
|
||||
|
||||
@@ -134,8 +134,8 @@ lv_disp_t * lv_disp_drv_register(lv_disp_drv_t * driver)
|
||||
disp->act_scr = lv_obj_create(NULL); /*Create a default screen on the display*/
|
||||
disp->top_layer = lv_obj_create(NULL); /*Create top layer on the display*/
|
||||
disp->sys_layer = lv_obj_create(NULL); /*Create sys layer on the display*/
|
||||
lv_obj_remove_style(disp->top_layer, LV_PART_ANY, LV_STATE_ANY, NULL);
|
||||
lv_obj_remove_style(disp->sys_layer, LV_PART_ANY, LV_STATE_ANY, NULL);
|
||||
lv_obj_remove_style_all(disp->top_layer);
|
||||
lv_obj_remove_style_all(disp->sys_layer);
|
||||
lv_obj_clear_flag(disp->top_layer, LV_OBJ_FLAG_CLICKABLE);
|
||||
lv_obj_clear_flag(disp->sys_layer, LV_OBJ_FLAG_CLICKABLE);
|
||||
|
||||
|
||||
@@ -74,7 +74,9 @@ bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop)
|
||||
{
|
||||
LV_ASSERT_STYLE(style);
|
||||
|
||||
if(style->prop_cnt <= 1) {
|
||||
if(style->prop_cnt == 0) return false;
|
||||
|
||||
if(style->prop_cnt == 1) {
|
||||
if(style->prop1 == prop) {
|
||||
style->prop1 = LV_STYLE_PROP_INV;
|
||||
style->prop_cnt = 0;
|
||||
@@ -103,6 +105,10 @@ bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop)
|
||||
tmp = new_values_and_props + style->prop_cnt * sizeof(lv_style_value_t);
|
||||
new_props = (uint16_t *)tmp;
|
||||
new_values = (lv_style_value_t *)new_values_and_props;
|
||||
} else {
|
||||
style->prop_cnt = 1;
|
||||
style->prop1 = i == 0 ? old_props[1] : old_props[0];
|
||||
style->v_p.value1 = i == 0 ? old_values[1] : old_values[0];
|
||||
}
|
||||
|
||||
uint32_t j;
|
||||
@@ -166,6 +172,7 @@ void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_
|
||||
size_t size = (style->prop_cnt + 1) * (sizeof(lv_style_value_t) + sizeof(uint16_t));
|
||||
uint8_t * values_and_props = lv_mem_alloc(size);
|
||||
if(values_and_props == NULL) return;
|
||||
lv_style_value_t value_tmp = style->v_p.value1;
|
||||
style->v_p.values_and_props = values_and_props;
|
||||
style->prop_cnt++;
|
||||
|
||||
@@ -174,7 +181,7 @@ void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_
|
||||
lv_style_value_t * values = (lv_style_value_t *)values_and_props;
|
||||
props[0] = style->prop1;
|
||||
props[1] = prop;
|
||||
values[0] = style->v_p.value1;
|
||||
values[0] = value_tmp;
|
||||
values[1] = value;
|
||||
} else {
|
||||
style->prop_cnt = 1;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
static void lv_arc_constructor(lv_obj_t * obj);
|
||||
static void lv_arc_draw(lv_obj_t * obj);
|
||||
static void lv_arc_event(lv_obj_t * obj, lv_event_t e);
|
||||
static void inv_arc_area(lv_obj_t * arc, uint16_t start_angle, uint16_t end_angle, uint8_t part);
|
||||
static void inv_arc_area(lv_obj_t * arc, uint16_t start_angle, uint16_t end_angle, lv_part_t part);
|
||||
static void get_center(lv_obj_t * obj, lv_point_t * center, lv_coord_t * arc_r);
|
||||
static void get_knob_area(lv_obj_t * arc, const lv_point_t * center, lv_coord_t r, lv_area_t * knob_area);
|
||||
static void value_update(lv_obj_t * arc);
|
||||
@@ -716,7 +716,7 @@ static void lv_arc_draw(lv_obj_t * obj)
|
||||
lv_draw_rect(&knob_area, clip_area, &knob_rect_dsc);
|
||||
}
|
||||
|
||||
static void inv_arc_area(lv_obj_t * obj, uint16_t start_angle, uint16_t end_angle, uint8_t part)
|
||||
static void inv_arc_area(lv_obj_t * obj, uint16_t start_angle, uint16_t end_angle, lv_part_t part)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
lv_arc_t * arc = (lv_arc_t *)obj;
|
||||
|
||||
@@ -552,7 +552,7 @@ void lv_textarea_set_password_show_time(lv_obj_t * obj, uint16_t time)
|
||||
|
||||
void lv_textarea_set_align(lv_obj_t * obj, lv_text_align_t align)
|
||||
{
|
||||
lv_obj_set_style_text_align(obj, LV_PART_MAIN, LV_STATE_DEFAULT, align);
|
||||
lv_obj_set_style_text_align(obj, align, 0);
|
||||
|
||||
switch(align) {
|
||||
default:
|
||||
|
||||
@@ -68,7 +68,7 @@ typedef struct {
|
||||
extern const lv_obj_class_t lv_textarea_class;
|
||||
|
||||
enum {
|
||||
LV_PART_TEXTAREA_PLACEHOLDER = LV_PART_CUSTOM_1,
|
||||
LV_PART_TEXTAREA_PLACEHOLDER = LV_PART_CUSTOM_FIRST,
|
||||
};
|
||||
|
||||
/**********************
|
||||
|
||||
Reference in New Issue
Block a user