1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00
This commit is contained in:
Gabor Kiss-Vamosi 2021-04-27 16:02:03 +02:00
commit 44e502ecb3
2 changed files with 31 additions and 7 deletions

View File

@ -263,6 +263,18 @@ void lv_obj_clear_state(lv_obj_t * obj, lv_state_t state);
*/
void lv_obj_set_base_dir(lv_obj_t * obj, lv_bidi_dir_t dir);
/**
* Set the user_data field of the object
* @param obj pointer to an object
* @param user_data pointer to the new user_data.
*/
#if LV_USE_USER_DATA
static inline void lv_obj_set_user_data(lv_obj_t * obj, void * user_data)
{
obj->user_data = user_data;
}
#endif
/*=======================
* Getter functions
*======================*/
@ -313,6 +325,18 @@ bool lv_obj_has_state(const lv_obj_t * obj, lv_state_t state);
*/
void * lv_obj_get_group(const lv_obj_t * obj);
/**
* Get the user_data field of the object
* @param obj pointer to an object
* @return the pointer to the user_data of the object
*/
#if LV_USE_USER_DATA
static inline void * lv_obj_get_user_data(lv_obj_t * obj)
{
return obj->user_data;
}
#endif
/*=======================
* Other functions
*======================*/

View File

@ -24,10 +24,10 @@
#define LIGHT_COLOR_CARD lv_color_white()
#define LIGHT_COLOR_TEXT lv_palette_darken(LV_PALETTE_GREY, 4)
#define LIGHT_COLOR_GREY lv_palette_lighten(LV_PALETTE_GREY, 2)
#define DARK_COLOR_SCR lv_palette_darken(LV_PALETTE_GREY, 4)
#define DARK_COLOR_CARD lv_palette_darken(LV_PALETTE_GREY, 3)
#define DARK_COLOR_SCR lv_color_hex(0x15171A)
#define DARK_COLOR_CARD lv_color_hex(0x282b30)
#define DARK_COLOR_TEXT lv_palette_lighten(LV_PALETTE_GREY, 5)
#define DARK_COLOR_GREY lv_palette_darken(LV_PALETTE_GREY, 1)
#define DARK_COLOR_GREY lv_color_hex(0x2f3237)
#define TRANSITION_TIME LV_THEME_DEFAULT_TRANSITON_TIME
#define BORDER_WIDTH LV_DPX(2)
@ -230,8 +230,7 @@ static void style_init(void)
lv_style_set_transition(&styles->transition_normal, &trans_normal); /*Go back to default state with delay*/
style_init_reset(&styles->scrollbar);
lv_style_set_bg_opa(&styles->scrollbar, LV_OPA_COVER);
lv_style_set_bg_color(&styles->scrollbar, lv_palette_main(LV_PALETTE_GREY));
lv_style_set_bg_color(&styles->scrollbar, (theme.flags & MODE_DARK) ? lv_palette_darken(LV_PALETTE_GREY, 2) : lv_palette_main(LV_PALETTE_GREY));
lv_style_set_radius(&styles->scrollbar, LV_RADIUS_CIRCLE);
lv_style_set_pad_right(&styles->scrollbar, LV_DPX(7));
lv_style_set_pad_top(&styles->scrollbar, LV_DPX(7));
@ -404,7 +403,7 @@ static void style_init(void)
lv_style_set_pad_all(&styles->cb_marker, LV_DPX(3));
lv_style_set_border_width(&styles->cb_marker, BORDER_WIDTH);
lv_style_set_border_color(&styles->cb_marker, color_primary);
lv_style_set_bg_color(&styles->cb_marker, lv_color_white());
lv_style_set_bg_color(&styles->cb_marker, color_card);
lv_style_set_bg_opa(&styles->cb_marker, LV_OPA_COVER);
lv_style_set_radius(&styles->cb_marker, RADIUS_DEFAULT / 2);
@ -481,7 +480,7 @@ static void style_init(void)
lv_style_set_anim_time(&styles->ta_cursor, 400);
style_init_reset(&styles->ta_placeholder);
lv_style_set_text_color(&styles->ta_placeholder, lv_palette_main(LV_PALETTE_GREY));
lv_style_set_text_color(&styles->ta_placeholder, (theme.flags & MODE_DARK) ? lv_palette_darken(LV_PALETTE_GREY, 2) : lv_palette_lighten(LV_PALETTE_GREY, 1));
#endif
#if LV_USE_CALENDAR
@ -493,6 +492,7 @@ static void style_init(void)
style_init_reset(&styles->calendar_day);
lv_style_set_border_width(&styles->calendar_day, LV_DPX(1));
lv_style_set_border_color(&styles->calendar_day, color_grey);
lv_style_set_bg_color(&styles->calendar_day, color_card);
lv_style_set_bg_opa(&styles->calendar_day, LV_OPA_20);
#endif