fix minor example issues

This commit is contained in:
Gabor Kiss-Vamosi
2021-05-27 16:06:17 +02:00
parent 00dc5db326
commit e3fb5d2840
5 changed files with 6 additions and 4 deletions

View File

@@ -10,9 +10,7 @@ void lv_example_dropdown_2(void)
static const char * opts = "Apple\n"
"Banana\n"
"Orange\n"
"Melon\n"
"Grape\n"
"Raspberry";
"Melon";
lv_obj_t * dd;
dd = lv_dropdown_create(lv_scr_act());

View File

@@ -19,6 +19,8 @@ void lv_example_dropdown_3(void)
lv_obj_align(dropdown, LV_ALIGN_TOP_LEFT, 10, 10);
lv_dropdown_set_options(dropdown, "New project\n"
"New file\n"
"Save\n"
"Save as\n"
"Open project\n"
"Recent projects\n"
"Preferences\n"

View File

@@ -63,7 +63,7 @@ void lv_example_table_2(void)
lv_obj_t * table = lv_table_create(lv_scr_act());
/*Set a smaller height to the table. It'll make it scrollable*/
lv_obj_set_size(table, 150, 200);
lv_obj_set_size(table, LV_SIZE_CONTENT, 200);
lv_table_set_col_width(table, 0, 150);
lv_table_set_row_cnt(table, ITEM_CNT); /*Not required but avoids a lot of memory reallocation lv_table_set_set_value*/

View File

@@ -820,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->clip_corner, 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);

View File

@@ -479,6 +479,7 @@ void lv_dropdown_open(lv_obj_t * dropdown_obj)
else if(dir == LV_DIR_LEFT) lv_obj_align_to(dropdown->list, dropdown_obj, LV_ALIGN_OUT_LEFT_TOP, 0, 0);
else if(dir == LV_DIR_RIGHT) lv_obj_align_to(dropdown->list, dropdown_obj, LV_ALIGN_OUT_RIGHT_TOP, 0, 0);
lv_obj_update_layout(dropdown->list);
if(dropdown->dir == LV_DIR_LEFT || dropdown->dir == LV_DIR_RIGHT) {
lv_coord_t y1 = lv_obj_get_y(dropdown->list);