/** * Create an mpty list on the window. 'win_load_file_list' will fill it. * @param app pointer to a Files application */ static void win_create_list(lv_app_inst_t * app) { my_win_data_t * win_data = app->win_data; /*Delete the previous list*/ if(win_data->file_list != NULL) { lv_obj_del(win_data->file_list); } /*Create a new list*/ win_data->file_list = lv_list_create(app->win, NULL); lv_obj_set_width(win_data->file_list, lv_win_get_width(app->win)); lv_list_set_style_img(win_data->file_list, &style_btn_symbol); lv_obj_set_style(lv_page_get_scrl(win_data->file_list), lv_style_get(LV_STYLE_TRANSP_TIGHT, NULL)); lv_obj_set_drag_parent(win_data->file_list, true); lv_obj_set_drag_parent(lv_page_get_scrl(win_data->file_list), true); lv_cont_set_fit(win_data->file_list, false, true); lv_cont_set_layout(lv_page_get_scrl(win_data->file_list), LV_CONT_LAYOUT_COL_L); }
/** * Glue the object to the page. After it the page can be moved (dragged) with this object too. * @param obj pointer to an object on a page * @param glue true: enable glue, false: disable glue */ void lv_page_glue_obj(lv_obj_t * obj, bool glue) { lv_obj_set_drag_parent(obj, glue); lv_obj_set_drag(obj, glue); }