1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

merge master

This commit is contained in:
Gabor Kiss-Vamosi 2020-02-05 10:45:10 +01:00
commit 62e42d13d8
16 changed files with 154 additions and 66 deletions

View File

@ -534,10 +534,12 @@ void lv_obj_clean(lv_obj_t * obj)
}
/**
* Mark the object as invalid therefore its current position will be redrawn by 'lv_refr_task'
* Mark an area of an object as invalid.
* This area will be redrawn by 'lv_refr_task'
* @param obj pointer to an object
* @param area the area to redraw
*/
void lv_obj_invalidate(const lv_obj_t * obj)
void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area)
{
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
@ -548,31 +550,56 @@ void lv_obj_invalidate(const lv_obj_t * obj)
lv_disp_t * disp = lv_obj_get_disp(obj_scr);
if(obj_scr == lv_disp_get_scr_act(disp) || obj_scr == lv_disp_get_layer_top(disp) ||
obj_scr == lv_disp_get_layer_sys(disp)) {
/*Truncate recursively to the parents*/
lv_area_t area_trunc;
lv_obj_t * par = lv_obj_get_parent(obj);
bool union_ok = true;
/*Start with the original coordinates*/
lv_coord_t ext_size = obj->ext_draw_pad;
lv_area_copy(&area_trunc, &obj->coords);
area_trunc.x1 -= ext_size;
area_trunc.y1 -= ext_size;
area_trunc.x2 += ext_size;
area_trunc.y2 += ext_size;
/*Check through all parents*/
/*Truncate the area to the object*/
lv_area_t obj_coords;
lv_coord_t ext_size = obj->ext_draw_pad;
lv_area_copy(&obj_coords, &obj->coords);
obj_coords.x1 -= ext_size;
obj_coords.y1 -= ext_size;
obj_coords.x2 += ext_size;
obj_coords.y2 += ext_size;
bool is_common;
lv_area_t area_trunc;
is_common = lv_area_intersect(&area_trunc, area, &obj_coords);
if(is_common == false) return; /*The area is not on the object*/
/*Truncate recursively to the parents*/
lv_obj_t * par = lv_obj_get_parent(obj);
while(par != NULL) {
union_ok = lv_area_intersect(&area_trunc, &area_trunc, &par->coords);
if(union_ok == false) break; /*If no common parts with parent break;*/
is_common = lv_area_intersect(&area_trunc, &area_trunc, &par->coords);
if(is_common == false) break; /*If no common parts with parent break;*/
if(lv_obj_get_hidden(par)) return; /*If the parent is hidden then the child is hidden and won't be drawn*/
par = lv_obj_get_parent(par);
}
if(union_ok) lv_inv_area(disp, &area_trunc);
if(is_common) lv_inv_area(disp, &area_trunc);
}
}
/**
* Mark the object as invalid therefore its current position will be redrawn by 'lv_refr_task'
* @param obj pointer to an object
*/
void lv_obj_invalidate(const lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
/*Truncate the area to the object*/
lv_area_t obj_coords;
lv_coord_t ext_size = obj->ext_draw_pad;
lv_area_copy(&obj_coords, &obj->coords);
obj_coords.x1 -= ext_size;
obj_coords.y1 -= ext_size;
obj_coords.x2 += ext_size;
obj_coords.y2 += ext_size;
lv_obj_invalidate_area(obj, &obj_coords);
}
/*=====================
* Setter functions
*====================*/

View File

@ -321,6 +321,15 @@ void lv_obj_del_async(struct _lv_obj_t *obj);
*/
void lv_obj_clean(lv_obj_t * obj);
/**
* Mark an area of an object as invalid.
* This area will be redrawn by 'lv_refr_task'
* @param obj pointer to an object
* @param area the area to redraw
*/
void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area);
/**
* Mark the object as invalid therefore its current position will be redrawn by 'lv_refr_task'
* @param obj pointer to an object

View File

@ -269,7 +269,7 @@ static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t
/*Kern classes*/
const lv_font_fmt_txt_kern_classes_t * kdsc = fdsc->kern_dsc;
uint8_t left_class = kdsc->left_class_mapping[gid_left];
uint8_t right_class = kdsc->left_class_mapping[gid_right];
uint8_t right_class = kdsc->right_class_mapping[gid_right];
/* If class = 0, kerning not exist for that glyph
* else got the value form `class_pair_values` 2D array*/
@ -489,5 +489,5 @@ static uint8_t rle_next(void)
*/
static int32_t unicode_list_compare(const void * ref, const void * element)
{
return (*(uint16_t *)ref) - (*(uint16_t *)element);
return ((int32_t)(*(uint16_t *)ref)) - ((int32_t)(*(uint16_t *)element));
}

View File

@ -9,12 +9,12 @@ extern "C" {
#include "../lv_conf_internal.h"
/* In the font converter use this list as range:
61441, 61448, 61451, 61452, 61452, 61453, 61457, 61459, 61461, 61465,
61468, 61473, 61478, 61479, 61480, 61502, 61512, 61515, 61516, 61517,
61521, 61522, 61523, 61524, 61543, 61544, 61550, 61552, 61553, 61556,
61559, 61560, 61561, 61563, 61587, 61589, 61636, 61637, 61639, 61671,
61674, 61683, 61724, 61732, 61787, 61931, 62016, 62017, 62018, 62019,
62020, 62087, 62099, 62212, 62189, 62810, 63426, 63650
61441, 61448, 61451, 61452, 61453, 61457, 61459, 61461, 61465, 61468,
61473, 61478, 61479, 61480, 61502, 61512, 61515, 61516, 61517, 61521,
61522, 61523, 61524, 61543, 61544, 61550, 61552, 61553, 61556, 61559,
61560, 61561, 61563, 61587, 61589, 61636, 61637, 61639, 61671, 61674,
61683, 61724, 61732, 61787, 61931, 62016, 62017, 62018, 62019, 62020,
62087, 62099, 62212, 62189, 62810, 63426, 63650
*/
#define LV_SYMBOL_AUDIO "\xef\x80\x81" /*61441, 0xF001*/
@ -90,7 +90,6 @@ enum {
_LV_STR_SYMBOL_CLOSE,
_LV_STR_SYMBOL_POWER,
_LV_STR_SYMBOL_SETTINGS,
_LV_STR_SYMBOL_TRASH,
_LV_STR_SYMBOL_HOME,
_LV_STR_SYMBOL_DOWNLOAD,
_LV_STR_SYMBOL_DRIVE,
@ -110,6 +109,8 @@ enum {
_LV_STR_SYMBOL_RIGHT,
_LV_STR_SYMBOL_PLUS,
_LV_STR_SYMBOL_MINUS,
_LV_STR_SYMBOL_EYE_OPEN,
_LV_STR_SYMBOL_EYE_CLOSE,
_LV_STR_SYMBOL_WARNING,
_LV_STR_SYMBOL_SHUFFLE,
_LV_STR_SYMBOL_UP,
@ -122,6 +123,7 @@ enum {
_LV_STR_SYMBOL_COPY,
_LV_STR_SYMBOL_SAVE,
_LV_STR_SYMBOL_CHARGE,
_LV_STR_SYMBOL_PASTE,
_LV_STR_SYMBOL_BELL,
_LV_STR_SYMBOL_KEYBOARD,
_LV_STR_SYMBOL_GPS,
@ -132,7 +134,12 @@ enum {
_LV_STR_SYMBOL_BATTERY_2,
_LV_STR_SYMBOL_BATTERY_1,
_LV_STR_SYMBOL_BATTERY_EMPTY,
_LV_STR_SYMBOL_USB,
_LV_STR_SYMBOL_BLUETOOTH,
_LV_STR_SYMBOL_TRASH,
_LV_STR_SYMBOL_BACKSPACE,
_LV_STR_SYMBOL_SD_CARD,
_LV_STR_SYMBOL_NEW_LINE,
_LV_STR_SYMBOL_DUMMY,
};

View File

@ -188,11 +188,16 @@ bool lv_bidi_letter_is_neutral(uint32_t letter)
uint16_t lv_bidi_get_logical_pos(const char * str_in, char **bidi_txt, uint32_t len, lv_bidi_dir_t base_dir, uint32_t visual_pos, bool *is_rtl)
{
uint32_t pos_conv_len = get_txt_len(str_in, len);
void *buf = lv_mem_buf_get(len + pos_conv_len * sizeof(uint16_t));
char * buf = lv_mem_buf_get(len + 1);
if(buf == NULL) return (uint16_t) -1;
if (bidi_txt) *bidi_txt = buf;
uint16_t *pos_conv_buf = (uint16_t*) ((char*)buf + len);
uint16_t *pos_conv_buf = lv_mem_buf_get(pos_conv_len * sizeof(uint16_t));
if(pos_conv_buf == NULL) {
lv_mem_buf_release(buf);
return (uint16_t) -1;
}
if (bidi_txt) *bidi_txt = buf;
lv_bidi_process_paragraph(str_in, bidi_txt? *bidi_txt: NULL, len, base_dir, pos_conv_buf, pos_conv_len);
if (is_rtl) *is_rtl = IS_RTL_POS(pos_conv_buf[visual_pos]);
@ -216,12 +221,16 @@ uint16_t lv_bidi_get_logical_pos(const char * str_in, char **bidi_txt, uint32_t
uint16_t lv_bidi_get_visual_pos(const char * str_in, char **bidi_txt, uint16_t len, lv_bidi_dir_t base_dir, uint32_t logical_pos, bool *is_rtl)
{
uint32_t pos_conv_len = get_txt_len(str_in, len);
void *buf = lv_mem_buf_get(len + pos_conv_len * sizeof(uint16_t));
char * buf = lv_mem_buf_get(len + 1);
if(buf == NULL) return (uint16_t) -1;
if (bidi_txt) *bidi_txt = buf;
uint16_t *pos_conv_buf = (uint16_t*) ((char*)buf + len);
lv_bidi_process_paragraph(str_in, bidi_txt ? *bidi_txt: NULL, len, base_dir, pos_conv_buf, pos_conv_len);
uint16_t *pos_conv_buf = lv_mem_buf_get(pos_conv_len * sizeof(uint16_t));
if(pos_conv_buf == NULL) {
lv_mem_buf_release(buf);
return (uint16_t) -1;
}
if (bidi_txt) *bidi_txt = buf;
for (uint16_t i = 0; i < pos_conv_len; i++){
if (GET_POS(pos_conv_buf[i]) == logical_pos){
if (is_rtl) *is_rtl = IS_RTL_POS(pos_conv_buf[i]);

View File

@ -340,7 +340,6 @@ static inline uint8_t lv_color_to8(lv_color_t color)
static inline uint16_t lv_color_to16(lv_color_t color)
{
#if LV_COLOR_DEPTH == 1
if(color.full == 0)
return 0;
@ -369,9 +368,7 @@ static inline uint16_t lv_color_to16(lv_color_t color)
#endif
LV_COLOR_SET_B16(ret, LV_COLOR_GET_B(color) >> 3); /* 8 - 5 = 3*/
return ret.full;
#endif
return 0;
#endif
}
static inline uint32_t lv_color_to32(lv_color_t color)

View File

@ -1085,7 +1085,7 @@ static void invalidate_button_area(const lv_obj_t * btnm, uint16_t btn_idx)
btn_area.x2 += btnm_area.x1;
btn_area.y2 += btnm_area.y1;
lv_inv_area(lv_obj_get_disp(btnm), &btn_area);
lv_obj_invalidate_area(btnm, &btn_area);
}
/**

View File

@ -1511,13 +1511,13 @@ static void lv_chart_inv_lines(lv_obj_t * chart, uint16_t i)
if(i < ext->point_cnt - 1) {
coords.x1 = ((w * i) / (ext->point_cnt - 1)) + x_ofs - ext->series.width;
coords.x2 = ((w * (i + 1)) / (ext->point_cnt - 1)) + x_ofs + ext->series.width;
lv_inv_area(lv_obj_get_disp(chart), &coords);
lv_obj_invalidate_area(chart, &coords);
}
if(i > 0) {
coords.x1 = ((w * (i - 1)) / (ext->point_cnt - 1)) + x_ofs - ext->series.width;
coords.x2 = ((w * i) / (ext->point_cnt - 1)) + x_ofs + ext->series.width;
lv_inv_area(lv_obj_get_disp(chart), &coords);
lv_obj_invalidate_area(chart, &coords);
}
}
}

View File

@ -689,7 +689,7 @@ static void invalidate_indic(lv_obj_t * cpicker)
{
lv_area_t indic_area = get_indic_area(cpicker);
lv_inv_area(lv_obj_get_disp(cpicker), &indic_area);
lv_obj_invalidate_area(cpicker, &indic_area);
}
static lv_area_t get_indic_area(lv_obj_t * cpicker)

View File

@ -831,6 +831,10 @@ static lv_res_t release_handler(lv_obj_t * ddlist)
{
lv_ddlist_ext_t * ext = lv_obj_get_ext_attr(ddlist);
/*Only deal with clickable drop down lists*/
if(!lv_obj_get_click(ddlist))
return LV_RES_OK;
if(ext->opened == 0) { /*Open the list*/
ext->opened = 1;
lv_obj_set_drag(lv_page_get_scrl(ddlist), true);

View File

@ -312,7 +312,6 @@ void lv_label_set_array_text(lv_obj_t * label, const char * array, uint16_t size
void lv_label_set_static_text(lv_obj_t * label, const char * text)
{
LV_ASSERT_OBJ(label, LV_OBJX_NAME);
LV_ASSERT_STR(text);
lv_label_ext_t * ext = lv_obj_get_ext_attr(label);
if(ext->static_txt == 0 && ext->text != NULL) {
@ -1323,10 +1322,18 @@ static void lv_label_refr_text(lv_obj_t * label)
p.y -= style->text.line_space; /*Trim the last line space*/
uint32_t letter_id = lv_label_get_letter_on(label, &p);
/*Save letters under the dots and replace them with dots*/
uint32_t i;
/*Be sure there is space for the dots*/
size_t txt_len = strlen(ext->text);
uint32_t byte_id = lv_txt_encoded_get_byte_id(ext->text, letter_id);
while(byte_id + LV_LABEL_DOT_NUM > txt_len) {
byte_id -= lv_txt_encoded_size(&ext->text[byte_id]);
letter_id--;
}
/*Save letters under the dots and replace them with dots*/
uint32_t byte_id_ori = byte_id;
uint32_t i;
uint8_t len = 0;
for(i = 0; i <= LV_LABEL_DOT_NUM; i++) {
len += lv_txt_encoded_size(&ext->text[byte_id]);

View File

@ -875,6 +875,8 @@ static lv_res_t lv_page_signal(lv_obj_t * page, lv_signal_t sign, void * param)
/*Automatically move children to the scrollable object*/
else if(sign == LV_SIGNAL_CHILD_CHG) {
lv_obj_t * child;
if(ext->scrl == NULL) return LV_RES_OK;
const lv_style_t * style_bg = lv_page_get_style(page, LV_PAGE_STYLE_BG);
const lv_style_t * style_scrl = lv_page_get_style(page, LV_PAGE_STYLE_SCRL);
lv_fit_t fit_left = lv_page_get_scrl_fit_left(page);
lv_fit_t fit_right = lv_page_get_scrl_fit_right(page);
@ -1095,7 +1097,6 @@ static lv_res_t lv_page_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, voi
/*Hide scrollbars if required*/
if(page_ext->sb.mode == LV_SB_MODE_DRAG) {
lv_disp_t * disp = lv_obj_get_disp(page);
lv_area_t sb_area_tmp;
if(page_ext->sb.hor_draw) {
lv_area_copy(&sb_area_tmp, &page_ext->sb.hor_area);
@ -1103,7 +1104,7 @@ static lv_res_t lv_page_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, voi
sb_area_tmp.y1 += page->coords.y1;
sb_area_tmp.x2 += page->coords.x1;
sb_area_tmp.y2 += page->coords.y1;
lv_inv_area(disp, &sb_area_tmp);
lv_obj_invalidate_area(page, &sb_area_tmp);
page_ext->sb.hor_draw = 0;
}
if(page_ext->sb.ver_draw) {
@ -1112,10 +1113,12 @@ static lv_res_t lv_page_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, voi
sb_area_tmp.y1 += page->coords.y1;
sb_area_tmp.x2 += page->coords.x1;
sb_area_tmp.y2 += page->coords.y1;
lv_inv_area(disp, &sb_area_tmp);
lv_obj_invalidate_area(page, &sb_area_tmp);
page_ext->sb.ver_draw = 0;
}
}
} else if(sign == LV_SIGNAL_CLEANUP) {
page_ext->scrl = NULL;
}
return res;
@ -1172,7 +1175,6 @@ static void lv_page_sb_refresh(lv_obj_t * page)
}
/*Invalidate the current (old) scrollbar areas*/
lv_disp_t * disp = lv_obj_get_disp(page);
lv_area_t sb_area_tmp;
if(ext->sb.hor_draw != 0) {
lv_area_copy(&sb_area_tmp, &ext->sb.hor_area);
@ -1180,7 +1182,7 @@ static void lv_page_sb_refresh(lv_obj_t * page)
sb_area_tmp.y1 += page->coords.y1;
sb_area_tmp.x2 += page->coords.x1;
sb_area_tmp.y2 += page->coords.y1;
lv_inv_area(disp, &sb_area_tmp);
lv_obj_invalidate_area(page, &sb_area_tmp);
}
if(ext->sb.ver_draw != 0) {
lv_area_copy(&sb_area_tmp, &ext->sb.ver_area);
@ -1188,7 +1190,7 @@ static void lv_page_sb_refresh(lv_obj_t * page)
sb_area_tmp.y1 += page->coords.y1;
sb_area_tmp.x2 += page->coords.x1;
sb_area_tmp.y2 += page->coords.y1;
lv_inv_area(disp, &sb_area_tmp);
lv_obj_invalidate_area(page, &sb_area_tmp);
}
if(ext->sb.mode == LV_SB_MODE_DRAG && lv_indev_is_dragging(lv_indev_get_act()) == false) {
@ -1250,7 +1252,7 @@ static void lv_page_sb_refresh(lv_obj_t * page)
sb_area_tmp.y1 += page->coords.y1;
sb_area_tmp.x2 += page->coords.x1;
sb_area_tmp.y2 += page->coords.y1;
lv_inv_area(disp, &sb_area_tmp);
lv_obj_invalidate_area(page, &sb_area_tmp);
}
if(ext->sb.ver_draw != 0) {
lv_area_copy(&sb_area_tmp, &ext->sb.ver_area);
@ -1258,7 +1260,7 @@ static void lv_page_sb_refresh(lv_obj_t * page)
sb_area_tmp.y1 += page->coords.y1;
sb_area_tmp.x2 += page->coords.x1;
sb_area_tmp.y2 += page->coords.y1;
lv_inv_area(disp, &sb_area_tmp);
lv_obj_invalidate_area(page, &sb_area_tmp);
}
}

View File

@ -948,6 +948,7 @@ void lv_ta_set_cursor_blink_time(lv_obj_t * ta, uint16_t time)
a.path_cb = lv_anim_path_step;
lv_anim_create(&a);
} else {
lv_anim_del(ta, (lv_anim_exec_xcb_t)cursor_blink_anim);
ext->cursor.state = 1;
}
#else
@ -1594,14 +1595,13 @@ static void cursor_blink_anim(lv_obj_t * ta, lv_anim_value_t show)
if(show != ext->cursor.state) {
ext->cursor.state = show == 0 ? 0 : 1;
if(ext->cursor.type != LV_CURSOR_NONE && (ext->cursor.type & LV_CURSOR_HIDDEN) == 0) {
lv_disp_t * disp = lv_obj_get_disp(ta);
lv_area_t area_tmp;
lv_area_copy(&area_tmp, &ext->cursor.area);
area_tmp.x1 += ext->label->coords.x1;
area_tmp.y1 += ext->label->coords.y1;
area_tmp.x2 += ext->label->coords.x1;
area_tmp.y2 += ext->label->coords.y1;
lv_inv_area(disp, &area_tmp);
lv_obj_invalidate_area(ta, &area_tmp);
}
}
}
@ -1801,14 +1801,13 @@ static void refr_cursor_area(lv_obj_t * ta)
}
/*Save the new area*/
lv_disp_t * disp = lv_obj_get_disp(ta);
lv_area_t area_tmp;
lv_area_copy(&area_tmp, &ext->cursor.area);
area_tmp.x1 += ext->label->coords.x1;
area_tmp.y1 += ext->label->coords.y1;
area_tmp.x2 += ext->label->coords.x1;
area_tmp.y2 += ext->label->coords.y1;
lv_inv_area(disp, &area_tmp);
lv_obj_invalidate_area(ta, &area_tmp);
lv_area_copy(&ext->cursor.area, &cur_area);
@ -1817,7 +1816,7 @@ static void refr_cursor_area(lv_obj_t * ta)
area_tmp.y1 += ext->label->coords.y1;
area_tmp.x2 += ext->label->coords.x1;
area_tmp.y2 += ext->label->coords.y1;
lv_inv_area(disp, &area_tmp);
lv_obj_invalidate_area(ta, &area_tmp);
}
static void placeholder_update(lv_obj_t * ta)

View File

@ -112,8 +112,17 @@ lv_obj_t * lv_tabview_create(lv_obj_t * par, const lv_obj_t * copy)
/* Set a size which fits into the parent.
* Don't use `par` directly because if the tabview is created on a page it is moved to the
* scrollable so the parent has changed */
lv_obj_set_size(new_tabview, lv_obj_get_width_fit(lv_obj_get_parent(new_tabview)),
lv_obj_get_height_fit(lv_obj_get_parent(new_tabview)));
lv_coord_t w;
lv_coord_t h;
if(par) {
w = lv_obj_get_width_fit(lv_obj_get_parent(new_tabview));
h = lv_obj_get_height_fit(lv_obj_get_parent(new_tabview));
} else {
w = lv_disp_get_hor_res(NULL);
h = lv_disp_get_ver_res(NULL);
}
lv_obj_set_size(new_tabview, w, h);
ext->content = lv_page_create(new_tabview, NULL);
ext->btns = lv_btnm_create(new_tabview, NULL);

View File

@ -101,10 +101,20 @@ lv_obj_t * lv_tileview_create(lv_obj_t * par, const lv_obj_t * copy)
/* Set a size which fits into the parent.
* Don't use `par` directly because if the tileview is created on a page it is moved to the
* scrollable so the parent has changed */
lv_obj_set_size(new_tileview, lv_obj_get_width_fit(lv_obj_get_parent(new_tileview)),
lv_obj_get_height_fit(lv_obj_get_parent(new_tileview)));
lv_obj_set_drag_dir(lv_page_get_scrl(new_tileview), LV_DRAG_DIR_ONE);
lv_obj_set_drag_throw(lv_page_get_scrl(new_tileview), true);
lv_coord_t w;
lv_coord_t h;
if(par) {
w = lv_obj_get_width_fit(lv_obj_get_parent(new_tileview));
h = lv_obj_get_height_fit(lv_obj_get_parent(new_tileview));
} else {
w = lv_disp_get_hor_res(NULL);
h = lv_disp_get_ver_res(NULL);
}
lv_obj_set_size(new_tileview, w, h);
lv_obj_set_drag_throw(lv_page_get_scrl(new_tileview), false);
lv_page_set_scrl_fit(new_tileview, LV_FIT_TIGHT);
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();

View File

@ -78,10 +78,18 @@ lv_obj_t * lv_win_create(lv_obj_t * par, const lv_obj_t * copy)
/* Set a size which fits into the parent.
* Don't use `par` directly because if the window is created on a page it is moved to the
* scrollable so the parent has changed */
lv_obj_set_size(new_win, lv_obj_get_width_fit(lv_obj_get_parent(new_win)),
lv_obj_get_height_fit(lv_obj_get_parent(new_win)));
lv_coord_t w;
lv_coord_t h;
if(par) {
w = lv_obj_get_width_fit(lv_obj_get_parent(new_win));
h = lv_obj_get_height_fit(lv_obj_get_parent(new_win));
} else {
w = lv_disp_get_hor_res(NULL);
h = lv_disp_get_ver_res(NULL);
}
lv_obj_set_size(new_win, w, h);
lv_obj_set_pos(new_win, 0, 0);
lv_obj_set_style(new_win, &lv_style_pretty);
ext->page = lv_page_create(new_win, NULL);