mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
minor fixes
This commit is contained in:
parent
7b8de7af8a
commit
3bbe46f74f
@ -8,7 +8,7 @@ static void event_handler(lv_event_t * e)
|
||||
if(code == LV_EVENT_VALUE_CHANGED) {
|
||||
const char * txt = lv_checkbox_get_text(obj);
|
||||
const char * state = lv_obj_get_state(obj) & LV_STATE_CHECKED ? "Checked" : "Unchecked";
|
||||
LV_LOG_USER("%s: %s\n", txt, state);
|
||||
LV_LOG_USER("%s: %s", txt, state);
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ void lv_example_checkbox_1(void)
|
||||
|
||||
cb = lv_checkbox_create(lv_scr_act());
|
||||
lv_obj_add_state(cb, LV_STATE_CHECKED | LV_STATE_DISABLED);
|
||||
lv_checkbox_set_text(cb, "Melon");
|
||||
lv_checkbox_set_text(cb, "Melon\nand a new line");
|
||||
lv_obj_add_event_cb(cb, event_handler, LV_EVENT_ALL, NULL);
|
||||
|
||||
lv_obj_update_layout(cb);
|
||||
|
@ -98,9 +98,7 @@ enum {
|
||||
};
|
||||
typedef uint8_t lv_img_cf_t;
|
||||
|
||||
/**
|
||||
* LVGL image header
|
||||
*/
|
||||
|
||||
/**
|
||||
* The first 8 bit is very important to distinguish the different source types.
|
||||
* For more info see `lv_img_get_src_type()` in lv_img.c
|
||||
@ -135,9 +133,9 @@ typedef struct {
|
||||
/** Image header it is compatible with
|
||||
* the result from image converter utility*/
|
||||
typedef struct {
|
||||
lv_img_header_t header;
|
||||
uint32_t data_size;
|
||||
const uint8_t * data;
|
||||
lv_img_header_t header; /**< A header describing the basics of the image*/
|
||||
uint32_t data_size; /**< Size of the image in bytes*/
|
||||
const uint8_t * data; /**< Pointer to the data of the image*/
|
||||
} lv_img_dsc_t;
|
||||
|
||||
typedef struct {
|
||||
|
@ -89,6 +89,10 @@ typedef struct {
|
||||
lv_style_t chart_series, chart_indic, chart_ticks, chart_bg;
|
||||
#endif
|
||||
|
||||
#if LV_USE_DROPDOWN
|
||||
lv_style_t dropdown_list;
|
||||
#endif
|
||||
|
||||
#if LV_USE_CHECKBOX
|
||||
lv_style_t cb_marker, cb_marker_checked;
|
||||
#endif
|
||||
@ -390,6 +394,10 @@ static void style_init(void)
|
||||
lv_style_set_arc_color(&styles->arc_indic_primary, theme.color_primary);
|
||||
#endif
|
||||
|
||||
#if LV_USE_DROPDOWN
|
||||
style_init_reset(&styles->dropdown_list);
|
||||
lv_style_set_max_height(&styles->dropdown_list, LV_DPI_DEF * 2);
|
||||
#endif
|
||||
#if LV_USE_CHECKBOX
|
||||
style_init_reset(&styles->cb_marker);
|
||||
lv_style_set_pad_all(&styles->cb_marker, LV_DPX(3));
|
||||
@ -812,6 +820,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
|
||||
else if(lv_obj_check_type(obj, &lv_dropdownlist_class)) {
|
||||
lv_obj_add_style(obj, &styles->card, 0);
|
||||
lv_obj_add_style(obj, &styles->line_space_large, 0);
|
||||
lv_obj_add_style(obj, &styles->dropdown_list, 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user