api(align) save align in style and handle x/y according to it
This commit is contained in:
@@ -28,7 +28,7 @@ void lv_example_dropdown_1(void)
|
||||
"Lemon\n"
|
||||
"Nuts");
|
||||
|
||||
lv_obj_align(dd, NULL, LV_ALIGN_IN_TOP_MID, 0, 20);
|
||||
lv_obj_align(dd, LV_ALIGN_TOP_MID, 0, 20);
|
||||
lv_obj_add_event_cb(dd, event_handler, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,25 +17,25 @@ void lv_example_dropdown_2(void)
|
||||
lv_obj_t * dd;
|
||||
dd = lv_dropdown_create(lv_scr_act());
|
||||
lv_dropdown_set_options_static(dd, opts);
|
||||
lv_obj_align(dd, NULL, LV_ALIGN_IN_TOP_MID, 0, 10);
|
||||
lv_obj_align(dd, LV_ALIGN_TOP_MID, 0, 10);
|
||||
|
||||
dd = lv_dropdown_create(lv_scr_act());
|
||||
lv_dropdown_set_options_static(dd, opts);
|
||||
lv_dropdown_set_dir(dd, LV_DIR_BOTTOM);
|
||||
lv_dropdown_set_symbol(dd, LV_SYMBOL_UP);
|
||||
lv_obj_align(dd, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, -10);
|
||||
lv_obj_align(dd, LV_ALIGN_BOTTOM_MID, 0, -10);
|
||||
|
||||
dd = lv_dropdown_create(lv_scr_act());
|
||||
lv_dropdown_set_options_static(dd, opts);
|
||||
lv_dropdown_set_dir(dd, LV_DIR_RIGHT);
|
||||
lv_dropdown_set_symbol(dd, LV_SYMBOL_RIGHT);
|
||||
lv_obj_align(dd, NULL, LV_ALIGN_IN_LEFT_MID, 10, 0);
|
||||
lv_obj_align(dd, LV_ALIGN_LEFT_MID, 10, 0);
|
||||
|
||||
dd = lv_dropdown_create(lv_scr_act());
|
||||
lv_dropdown_set_options_static(dd, opts);
|
||||
lv_dropdown_set_dir(dd, LV_DIR_LEFT);
|
||||
lv_dropdown_set_symbol(dd, LV_SYMBOL_LEFT);
|
||||
lv_obj_align(dd, NULL, LV_ALIGN_IN_RIGHT_MID, -10, 0);
|
||||
lv_obj_align(dd, LV_ALIGN_RIGHT_MID, -10, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,7 +17,7 @@ void lv_example_dropdown_3(void)
|
||||
{
|
||||
/*Create a drop down list*/
|
||||
lv_obj_t * dropdown = lv_dropdown_create(lv_scr_act());
|
||||
lv_obj_align(dropdown, NULL, LV_ALIGN_IN_TOP_LEFT, 10, 10);
|
||||
lv_obj_align(dropdown, LV_ALIGN_TOP_LEFT, 10, 10);
|
||||
lv_dropdown_set_options(dropdown, "New project\n"
|
||||
"New file\n"
|
||||
"Open project\n"
|
||||
|
||||
Reference in New Issue
Block a user