1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

minor fixes

This commit is contained in:
Gabor Kiss-Vamosi 2020-04-06 16:21:53 +02:00
parent d75ea5f482
commit 5ab7222bd9
3 changed files with 9 additions and 7 deletions

View File

@ -807,7 +807,7 @@
#endif
#if LV_USE_LED
#ifndef LV_LED_BRIGHT_MIN
# define LV_LED_BRIGHT_MIN 80 /*Minimal brightness*/
# define LV_LED_BRIGHT_MIN 120 /*Minimal brightness*/
#endif
#ifndef LV_LED_BRIGHT_MAX
# define LV_LED_BRIGHT_MAX 255 /*Maximal brightness*/

View File

@ -558,6 +558,7 @@ static void cpicker_init(void)
lv_style_set_bg_opa(&cpicker_indic, LV_STATE_DEFAULT, LV_OPA_COVER);
lv_style_set_border_width(&cpicker_indic, LV_STATE_DEFAULT, 2);
lv_style_set_border_color(&cpicker_indic, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_style_set_border_color(&cpicker_indic, LV_STATE_FOCUSED, theme.color_primary);
lv_style_set_pad_left(&cpicker_indic, LV_STATE_DEFAULT, LV_DPI / 15);
lv_style_set_pad_right(&cpicker_indic, LV_STATE_DEFAULT, LV_DPI / 15);
lv_style_set_pad_top(&cpicker_indic, LV_STATE_DEFAULT, LV_DPI / 15);
@ -691,6 +692,7 @@ static void list_init(void)
lv_style_set_border_side(&list_btn, LV_STATE_DEFAULT, LV_BORDER_SIDE_BOTTOM);
lv_style_set_border_color(&list_btn, LV_STATE_DEFAULT, COLOR_BG_BORDER);
lv_style_set_border_color(&list_btn, LV_STATE_FOCUSED, theme.color_primary);
lv_style_set_border_width(&list_btn, LV_STATE_DEFAULT, 1);
lv_style_set_pad_left(&list_btn, LV_STATE_DEFAULT, LV_DPI / 10);
@ -720,7 +722,7 @@ static void ddlist_init(void)
lv_style_init(&ddlist_sel);
lv_style_set_bg_opa(&ddlist_sel, LV_STATE_DEFAULT, LV_OPA_COVER);
lv_style_set_bg_color(&ddlist_sel, LV_STATE_DEFAULT, theme.color_primary);
lv_style_set_text_color(&ddlist_sel, LV_STATE_DEFAULT, IS_LIGHT ? lv_color_hex3(0x333) : lv_color_hex3(0xfff));
lv_style_set_text_color(&ddlist_sel, LV_STATE_DEFAULT, IS_LIGHT ? lv_color_hex3(0xfff) : lv_color_hex3(0xfff));
lv_style_set_bg_color(&ddlist_sel, LV_STATE_PRESSED, COLOR_BG_PR);
#endif
}
@ -761,6 +763,7 @@ static void tabview_init(void)
lv_style_set_text_color(&tabview_btns, LV_STATE_CHECKED, COLOR_SCR_TEXT);
lv_style_set_pad_top(&tabview_btns, LV_STATE_DEFAULT, LV_DPI / 10);
lv_style_set_pad_bottom(&tabview_btns, LV_STATE_DEFAULT, LV_DPI / 10);
lv_style_set_text_color(&tabview_btns, LV_STATE_FOCUSED, theme.color_primary);
lv_style_init(&tabview_indic);
lv_style_set_bg_opa(&tabview_indic, LV_STATE_DEFAULT, LV_OPA_COVER);
@ -957,7 +960,6 @@ void lv_theme_material_apply(lv_obj_t * obj, lv_theme_style_t name)
lv_obj_clean_style_list(obj, LV_SWITCH_PART_INDIC);
list = lv_obj_get_style_list(obj, LV_SWITCH_PART_INDIC);
lv_style_list_add_style(list, &bar_indic);
lv_style_list_add_style(list, &bg);
lv_obj_clean_style_list(obj, LV_SWITCH_PART_KNOB);
list = lv_obj_get_style_list(obj, LV_SWITCH_PART_KNOB);

View File

@ -79,10 +79,6 @@ lv_obj_t * lv_spinbox_create(lv_obj_t * par, const lv_obj_t * copy)
ext->range_max = 99999;
ext->range_min = -99999;
lv_textarea_set_one_line(spinbox, true);
lv_textarea_set_cursor_click_pos(spinbox, true);
lv_theme_apply(spinbox, LV_THEME_SPINBOX);
/*The signal and design functions are not copied so set them here*/
lv_obj_set_signal_cb(spinbox, lv_spinbox_signal);
@ -93,6 +89,10 @@ lv_obj_t * lv_spinbox_create(lv_obj_t * par, const lv_obj_t * copy)
/* No scrolling will happen here so make the scrollable non-clickable
* It allows to handle input events in the bg object only.*/
lv_obj_set_click(lv_page_get_scrl(spinbox), false);
lv_textarea_set_one_line(spinbox, true);
lv_textarea_set_cursor_click_pos(spinbox, true);
lv_obj_set_width(spinbox, LV_DPI);
lv_theme_apply(spinbox, LV_THEME_SPINBOX);
}
/*Copy an existing spinbox*/
else {