1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

LV_PROTECT_FOLLOW added to 'line break' to LV_CONT_LAYOUT_PRETTY

This commit is contained in:
Kiss-Vamosi Gabor 2017-07-07 23:02:08 +02:00
parent 889807b449
commit 056d449f89
4 changed files with 173 additions and 37 deletions

View File

@ -39,6 +39,7 @@ typedef struct
/*Application specific data a window of this application*/
typedef struct
{
lv_obj_t * value_l;
}my_win_data_t;
@ -59,15 +60,15 @@ static void my_sc_close(lv_app_inst_t * app);
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win);
static void my_win_close(lv_app_inst_t * app);
static lv_action_res_t ta_rel_action(lv_obj_t * ta, lv_dispi_t * dispi);
static void kb_ok_action(lv_obj_t * ta);
static void refr_monitor(uint32_t time_ms, uint32_t px_num);
static lv_action_res_t run_once_rel_action(lv_obj_t * btn, lv_dispi_t * dispi);
/**********************
* STATIC VARIABLES
**********************/
static lv_app_dsc_t my_app_dsc =
{
.name = "Benchamrk",
.name = "Benchmark",
.mode = LV_APP_MODE_NONE,
.app_run = my_app_run,
.app_close = my_app_close,
@ -81,6 +82,15 @@ static lv_app_dsc_t my_app_dsc =
.win_data_size = sizeof(my_win_data_t),
};
static lv_style_t style_scrl;
static lv_style_t style_btn_rel;
static lv_style_t style_btn_pr;
static lv_style_t style_opa;
static bool caputre_next;
LV_IMG_DECLARE(img_bg);
/**********************
* MACROS
**********************/
@ -95,6 +105,15 @@ static lv_app_dsc_t my_app_dsc =
*/
const lv_app_dsc_t * lv_app_benchmark_init(void)
{
lv_refr_set_monitor_cb(refr_monitor);
lv_img_create_file("app_bm_wp", img_bg);
lv_style_get(LV_STYLE_BTN_REL, &style_btn_rel);
lv_style_get(LV_STYLE_BTN_PR, &style_btn_pr);
lv_style_get(LV_STYLE_TRANSP, &style_scrl);
style_scrl.opad = LV_DPI / 6;
return &my_app_dsc;
}
@ -111,6 +130,7 @@ const lv_app_dsc_t * lv_app_benchmark_init(void)
static void my_app_run(lv_app_inst_t * app, void * conf)
{
/*Initialize the application*/
}
/**
@ -177,13 +197,62 @@ static void my_sc_close(lv_app_inst_t * app)
*/
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win)
{
lv_obj_t * ta;
ta = lv_ta_create(win, NULL);
lv_obj_set_size_us(ta, 200, 100);
lv_obj_set_pos_us(ta, 0, 0);
lv_obj_set_free_p(ta, app);
lv_page_set_rel_action(ta, ta_rel_action);
lv_ta_set_text(ta, "Write a text to send to the other applications");
my_win_data_t * wdata = app->win_data;
lv_obj_set_style(lv_page_get_scrl(lv_win_get_page(win)), &style_scrl);
lv_obj_t * wp;
wp = lv_img_create(win, NULL);
lv_obj_set_protect(wp, LV_PROTECT_PARENT);
lv_obj_set_parent(wp, lv_win_get_page(win));
lv_img_set_file(wp, "U:/app_bm_wp");
lv_obj_set_size(wp, LV_HOR_RES, LV_VER_RES - lv_obj_get_height(lv_win_get_header(win)));
lv_obj_set_pos(wp, 0, 0);
/* The order is changed because the wallpaper's parent change
* Therefore add the scrollable again */
lv_obj_set_parent(lv_page_get_scrl(lv_win_get_page(win)), lv_win_get_page(win));
lv_cont_set_layout(lv_page_get_scrl(lv_win_get_page(win)), LV_CONT_LAYOUT_PRETTY);
lv_obj_t * holder;
holder = lv_cont_create(win, NULL);
lv_cont_set_fit(holder, true, true);
lv_obj_set_style(holder, &style_btn_rel);
wdata->value_l = lv_label_create(holder, NULL);
lv_label_set_text(wdata->value_l, "2345654 px in 23 ms\n12313 px/ms");
lv_obj_t * btn;
btn = lv_btn_create(win, NULL);
lv_cont_set_fit(btn, true, true);
lv_btn_set_styles(btn, &style_btn_rel, &style_btn_pr, &style_btn_rel, &style_btn_pr, NULL);
lv_btn_set_rel_action(btn, run_once_rel_action);
lv_obj_t * btn_l;
btn_l = lv_label_create(btn, NULL);
lv_label_set_text(btn_l, "Run\ntest!");
lv_obj_set_protect(btn, LV_PROTECT_FOLLOW);
lv_obj_t * cb;
cb = lv_cb_create(win, NULL);
lv_cb_set_text(cb, "Wallpaper");
lv_btn_set_styles(cb, &style_btn_rel, &style_btn_pr, &style_btn_rel, &style_btn_pr, NULL);
cb = lv_cb_create(win, cb);
lv_cb_set_text(cb, "Img. recolor");
cb = lv_cb_create(win, cb);
lv_cb_set_text(cb, "Wp. upscale");
cb = lv_cb_create(win, cb);
lv_cb_set_text(cb, "Shadow");
cb = lv_cb_create(win, cb);
lv_cb_set_text(cb, "Opacity");
}
/**
@ -199,28 +268,90 @@ static void my_win_close(lv_app_inst_t * app)
* OTHER FUNCTIONS
---------------------*/
/**
* Called when the text area on the window is released to open the app. keyboard
* @param ta pointer to the text area on the window
* @param dispi pointer to the caller display input
* @return LV_ACTION_RES_OK because the text area is not deleted
*/
static lv_action_res_t ta_rel_action(lv_obj_t * ta, lv_dispi_t * dispi)
static void refr_monitor(uint32_t time_ms, uint32_t px_num)
{
lv_ta_set_text(ta, ""); /*Clear the ta*/
lv_app_kb_open(ta, LV_APP_KB_MODE_TXT | LV_APP_KB_MODE_WIN_RESIZE, NULL, kb_ok_action);
if(caputre_next != false) {
lv_app_inst_t * app = NULL;
app = lv_app_get_next(app, &my_app_dsc);
char buf[256];
if(time_ms != 0) sprintf(buf, "%d px in %d ms\n%d px/ms", px_num, time_ms, px_num/time_ms);
else sprintf(buf, "%d px in %d ms\nN/A px/ms", px_num, time_ms);
while(app != NULL) {
if(app->win_data != NULL) {
my_win_data_t * wdata = app->win_data;
lv_label_set_text(wdata->value_l, buf);
}
app = lv_app_get_next(app, &my_app_dsc);
}
caputre_next = false;
}
}
static lv_action_res_t run_once_rel_action(lv_obj_t * btn, lv_dispi_t * dispi)
{
lv_obj_inv(lv_scr_act());
caputre_next = true;
return LV_ACTION_RES_OK;
}
/**
* Called when the "Ok" button is pressed on the app. keyboard
* @param ta pointer to the text area assigned to the app. kexboard
*/
static void kb_ok_action(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
const char * txt = lv_ta_get_txt(ta);
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, txt, strlen(txt));
}
/*Exceptionally store the data because the big array would be bothering*/
const color_int_t img_bg[] = {
/*HEADER
Width = 40
Height = 40
Transp: 0
Color depth: 24*/
100827176,
/*IMAGE DATA*/
263172, 460551, 460551, 526344, 723723, 1447446, 1644825, 1447446, 1447446, 1052688, 1052688, 921102, 1052688, 723723, 263172, 197379, 131586, 65793, 65793, 0, 65793, 0, 65793, 65793, 65793, 65793, 65793, 328965, 789516, 855309, 1250067, 1052688, 1052688, 1184274, 1184274, 986895, 394758, 394758, 394758, 328965,
131586, 460551, 526344, 394758, 1776411, 2631720, 2105376, 1447446, 1250067, 1052688, 855309, 1052688, 1579032, 1250067, 460551, 65793, 65793, 65793, 65793, 65793, 0, 65793, 65793, 0, 0, 0, 328965, 986895, 1184274, 789516, 921102, 1250067, 1052688, 1052688, 1842204, 1644825, 1052688, 328965, 263172, 328965,
394758, 460551, 526344, 1052688, 2434341, 2434341, 2236962, 1907997, 1052688, 855309, 1052688, 1315860, 1381653, 1447446, 855309, 263172, 0, 0, 131586, 131586, 131586, 131586, 131586, 65793, 0, 263172, 855309, 1052688, 1052688, 1052688, 1118481, 921102, 986895, 1052688, 1579032, 1513239, 1513239, 1118481, 394758, 328965,
263172, 460551, 1447446, 1842204, 2171169, 1973790, 1973790, 1776411, 1052688, 986895, 1184274, 1250067, 921102, 1118481, 1118481, 723723, 263172, 0, 65793, 131586, 197379, 263172, 131586, 131586, 328965, 657930, 921102, 855309, 921102, 1052688, 1052688, 1052688, 855309, 1250067, 1579032, 1250067, 1842204, 1710618, 986895, 263172,
657930, 921102, 1842204, 1776411, 1250067, 1118481, 1052688, 1118481, 1315860, 1381653, 1052688, 855309, 1052688, 855309, 921102, 1184274, 1381653, 394758, 65793, 131586, 131586, 131586, 65793, 526344, 1579032, 1052688, 723723, 789516, 855309, 921102, 1052688, 1184274, 1315860, 1052688, 1315860, 1447446, 1513239, 1710618, 1644825, 855309,
1052688, 1315860, 1710618, 1250067, 1052688, 986895, 921102, 921102, 1052688, 1052688, 1184274, 855309, 855309, 921102, 1052688, 1776411, 2302755, 1644825, 394758, 0, 131586, 131586, 657930, 1776411, 1907997, 1710618, 855309, 723723, 855309, 986895, 1052688, 1052688, 1184274, 1184274, 1052688, 1184274, 1250067, 1513239, 1447446, 1184274,
1184274, 1052688, 986895, 1052688, 921102, 986895, 1184274, 1052688, 921102, 1052688, 1052688, 1052688, 986895, 1118481, 1907997, 1907997, 1973790, 2171169, 1513239, 394758, 65793, 657930, 1973790, 1973790, 1842204, 1776411, 1579032, 855309, 789516, 1052688, 986895, 986895, 986895, 1250067, 1315860, 1118481, 1250067, 1118481, 986895, 1118481,
1250067, 986895, 1052688, 855309, 986895, 1250067, 1184274, 1052688, 1052688, 1052688, 986895, 921102, 1315860, 1973790, 2105376, 1842204, 1842204, 1973790, 2171169, 1579032, 789516, 1710618, 2105376, 1973790, 1776411, 1907997, 1973790, 1710618, 1118481, 855309, 855309, 855309, 921102, 986895, 1315860, 1381653, 986895, 855309, 789516, 986895,
1250067, 855309, 1052688, 657930, 986895, 1118481, 1315860, 1118481, 986895, 986895, 855309, 1381653, 1907997, 2105376, 1842204, 1776411, 1842204, 1907997, 2105376, 2171169, 1776411, 2105376, 2236962, 2105376, 1842204, 1973790, 2171169, 2236962, 1776411, 1052688, 855309, 986895, 921102, 921102, 1118481, 1513239, 921102, 657930, 921102, 855309,
986895, 855309, 657930, 855309, 1052688, 1118481, 1118481, 986895, 855309, 657930, 1052688, 1776411, 1907997, 1907997, 1973790, 1907997, 1907997, 2171169, 1973790, 2236962, 2171169, 1973790, 2105376, 2105376, 1776411, 1973790, 2236962, 2236962, 2302755, 1842204, 1118481, 855309, 1052688, 1052688, 1052688, 1184274, 1118481, 1052688, 921102, 1052688,
1250067, 1250067, 855309, 1052688, 1052688, 986895, 1052688, 855309, 657930, 855309, 1710618, 1907997, 1907997, 2105376, 2171169, 2302755, 2368548, 2105376, 1973790, 1907997, 1842204, 1842204, 1907997, 1907997, 1842204, 1907997, 1973790, 1973790, 2171169, 2302755, 1776411, 855309, 855309, 1052688, 1052688, 986895, 1184274, 1184274, 855309, 1052688,
986895, 1052688, 1315860, 855309, 855309, 855309, 723723, 789516, 1052688, 1710618, 1973790, 1842204, 1973790, 2302755, 2434341, 2434341, 2302755, 1973790, 1842204, 1842204, 1842204, 1973790, 1907997, 2236962, 1907997, 1776411, 1907997, 1907997, 1973790, 2105376, 2236962, 1776411, 1052688, 855309, 855309, 1184274, 1052688, 986895, 1184274, 986895,
328965, 657930, 1052688, 1052688, 855309, 855309, 723723, 921102, 2105376, 2236962, 1907997, 1973790, 1710618, 2368548, 2434341, 2434341, 2368548, 2236962, 1842204, 1710618, 1842204, 1842204, 1907997, 1973790, 1907997, 1842204, 1776411, 1710618, 1776411, 1776411, 2171169, 2368548, 1907997, 855309, 986895, 1052688, 986895, 1118481, 1052688, 723723,
131586, 131586, 855309, 1118481, 1052688, 1118481, 1447446, 1907997, 1842204, 2105376, 1907997, 1776411, 1776411, 2171169, 2500134, 2171169, 2171169, 2236962, 1907997, 1907997, 2105376, 2105376, 2171169, 1973790, 1842204, 1776411, 1842204, 1776411, 1842204, 1842204, 2171169, 2105376, 2434341, 2105376, 1118481, 1052688, 1381653, 1315860, 657930, 328965,
65793, 131586, 263172, 657930, 855309, 1579032, 2236962, 2171169, 1776411, 1776411, 2105376, 1842204, 1776411, 1973790, 2631720, 2434341, 2302755, 2368548, 2105376, 1842204, 1776411, 2236962, 2171169, 1842204, 1842204, 1776411, 1842204, 1842204, 1842204, 2105376, 2105376, 2105376, 2500134, 2631720, 1907997, 1381653, 1052688, 789516, 263172, 197379,
65793, 131586, 131586, 131586, 526344, 1644825, 2105376, 1842204, 1907997, 1776411, 1907997, 2105376, 1842204, 1973790, 2105376, 2368548, 2236962, 2302755, 2368548, 2171169, 1513239, 2105376, 2171169, 1776411, 1644825, 1710618, 1644825, 1842204, 1973790, 1973790, 1842204, 2105376, 2236962, 2236962, 2565927, 2105376, 657930, 131586, 131586, 328965,
65793, 131586, 197379, 131586, 197379, 1315860, 1973790, 1973790, 1907997, 1907997, 1907997, 1842204, 1842204, 1973790, 2171169, 2236962, 2302755, 2434341, 2302755, 855309, 263172, 1184274, 1842204, 1973790, 1842204, 1710618, 1907997, 1842204, 1842204, 1973790, 1973790, 1842204, 2105376, 2302755, 2105376, 1184274, 328965, 197379, 131586, 263172,
65793, 131586, 131586, 65793, 0, 197379, 1250067, 2105376, 1973790, 1907997, 1973790, 1776411, 1842204, 2236962, 2171169, 2105376, 2500134, 2171169, 789516, 131586, 197379, 197379, 1184274, 2171169, 1907997, 1907997, 1842204, 1710618, 1710618, 1842204, 1907997, 1842204, 2171169, 2368548, 1315860, 65793, 263172, 394758, 263172, 197379,
65793, 131586, 131586, 131586, 65793, 0, 263172, 1315860, 1907997, 1907997, 1842204, 1907997, 1973790, 2302755, 2302755, 2236962, 2171169, 855309, 131586, 131586, 263172, 131586, 197379, 1052688, 1973790, 1907997, 1710618, 1710618, 1907997, 1842204, 1907997, 1973790, 1973790, 986895, 131586, 197379, 394758, 394758, 263172, 131586,
65793, 197379, 65793, 131586, 131586, 131586, 65793, 394758, 1579032, 1907997, 1907997, 1907997, 1973790, 2171169, 2565927, 2171169, 1118481, 263172, 131586, 197379, 197379, 131586, 131586, 197379, 1118481, 1776411, 1776411, 1776411, 1842204, 1907997, 1973790, 1973790, 1052688, 131586, 263172, 328965, 394758, 328965, 197379, 197379,
131586, 131586, 131586, 197379, 131586, 131586, 131586, 592137, 1644825, 1973790, 1842204, 1973790, 1973790, 2236962, 2500134, 2368548, 1447446, 263172, 65793, 197379, 197379, 131586, 131586, 394758, 1447446, 1776411, 1776411, 1842204, 1907997, 1973790, 2105376, 2171169, 1513239, 394758, 328965, 460551, 460551, 328965, 197379, 263172,
197379, 197379, 197379, 328965, 197379, 131586, 592137, 1710618, 2368548, 2302755, 1907997, 1907997, 2236962, 2434341, 2368548, 2434341, 2236962, 1052688, 131586, 65793, 197379, 131586, 328965, 1579032, 2302755, 1973790, 1842204, 1842204, 1842204, 1907997, 2105376, 2302755, 2500134, 1907997, 657930, 394758, 394758, 394758, 394758, 328965,
131586, 131586, 131586, 197379, 131586, 526344, 1776411, 2302755, 2434341, 2368548, 2171169, 1842204, 2302755, 2894892, 2302755, 2236962, 2171169, 1907997, 1118481, 197379, 131586, 394758, 1513239, 2236962, 2171169, 2105376, 2105376, 1842204, 1710618, 1842204, 1907997, 1907997, 2368548, 2565927, 1644825, 592137, 197379, 394758, 328965, 328965,
65793, 131586, 131586, 65793, 526344, 1842204, 2302755, 2236962, 2302755, 2302755, 2105376, 2105376, 2434341, 2894892, 2302755, 2105376, 1973790, 2105376, 2105376, 1381653, 592137, 1644825, 2236962, 2302755, 2105376, 1973790, 2171169, 2171169, 2105376, 2105376, 1973790, 1973790, 2171169, 2565927, 2565927, 1973790, 657930, 460551, 460551, 263172,
0, 65793, 65793, 263172, 855309, 1776411, 2434341, 2105376, 2236962, 2105376, 2302755, 2302755, 2368548, 2368548, 2105376, 2105376, 1973790, 2171169, 2302755, 2829099, 2565927, 2302755, 2500134, 2105376, 2105376, 1842204, 2171169, 2368548, 2302755, 2368548, 2171169, 1907997, 2368548, 2500134, 2894892, 1842204, 1579032, 789516, 197379, 263172,
0, 0, 197379, 789516, 1052688, 921102, 1710618, 2302755, 2105376, 2171169, 2302755, 2236962, 2105376, 2105376, 2302755, 2171169, 2171169, 2302755, 2105376, 2434341, 2302755, 2171169, 2302755, 2105376, 2105376, 1973790, 2105376, 2302755, 2302755, 2368548, 2434341, 2368548, 2500134, 3158064, 1973790, 1118481, 1907997, 1315860, 328965, 131586,
65793, 263172, 986895, 1184274, 1052688, 855309, 921102, 1644825, 2368548, 2631720, 2302755, 2236962, 2171169, 2302755, 2565927, 2368548, 2105376, 2105376, 1907997, 1907997, 1973790, 1776411, 2105376, 2171169, 2171169, 2105376, 1907997, 2302755, 2500134, 2434341, 2236962, 2434341, 2829099, 2434341, 1513239, 1184274, 1644825, 1776411, 921102, 394758,
657930, 1052688, 1381653, 1184274, 1052688, 1052688, 855309, 855309, 2105376, 2368548, 2105376, 1973790, 2171169, 2302755, 2565927, 2302755, 2171169, 1907997, 1776411, 1710618, 1776411, 1973790, 1842204, 2105376, 2236962, 2105376, 1907997, 1842204, 1776411, 2236962, 2368548, 2500134, 1973790, 1184274, 1513239, 1710618, 1250067, 1381653, 1776411, 1118481,
855309, 921102, 1118481, 1118481, 1184274, 1052688, 986895, 855309, 855309, 2631720, 2105376, 2105376, 2105376, 1973790, 2236962, 2302755, 2105376, 1907997, 2171169, 1907997, 1710618, 1842204, 1842204, 1842204, 2236962, 1842204, 1842204, 1710618, 1776411, 1842204, 1842204, 1579032, 1118481, 1513239, 1250067, 1579032, 1579032, 1513239, 1644825, 1052688,
986895, 855309, 723723, 1052688, 1052688, 1052688, 1250067, 1052688, 986895, 1052688, 1644825, 1907997, 1973790, 2302755, 2236962, 2236962, 2236962, 2236962, 1973790, 1907997, 1907997, 1710618, 2105376, 2302755, 2105376, 2105376, 2105376, 2105376, 1973790, 1973790, 1315860, 789516, 1118481, 1513239, 1579032, 1381653, 1513239, 1118481, 1052688, 1315860,
855309, 855309, 855309, 855309, 986895, 1184274, 1052688, 1118481, 1052688, 921102, 855309, 1842204, 2368548, 2302755, 2236962, 2105376, 2105376, 2236962, 2171169, 1973790, 1907997, 1842204, 2105376, 2434341, 2236962, 2171169, 2302755, 2434341, 2500134, 1776411, 986895, 855309, 1118481, 1250067, 1513239, 1776411, 1184274, 855309, 1052688, 1118481,
855309, 789516, 1052688, 1052688, 1052688, 1381653, 1250067, 1315860, 1447446, 1052688, 855309, 1052688, 1973790, 2302755, 2105376, 1973790, 2105376, 2171169, 2302755, 2171169, 1710618, 2105376, 2171169, 2171169, 2500134, 2631720, 2105376, 2434341, 1907997, 1052688, 1118481, 1513239, 1579032, 1579032, 1776411, 1776411, 1184274, 789516, 986895, 1184274,
986895, 855309, 789516, 1052688, 1250067, 1644825, 1776411, 1579032, 1184274, 1052688, 1052688, 986895, 1315860, 1776411, 2171169, 2171169, 2105376, 2302755, 2368548, 1315860, 592137, 1710618, 2236962, 2236962, 2171169, 2500134, 2171169, 1710618, 1315860, 1184274, 1644825, 1776411, 1776411, 1776411, 1644825, 1579032, 1184274, 921102, 855309, 1315860,
921102, 1052688, 1052688, 1184274, 1315860, 1250067, 1842204, 1776411, 1250067, 1184274, 1118481, 1052688, 986895, 1052688, 1710618, 2302755, 2302755, 2302755, 1315860, 263172, 65793, 526344, 1644825, 2368548, 2631720, 2434341, 1644825, 1052688, 1315860, 1644825, 1579032, 1710618, 1579032, 1447446, 1052688, 921102, 1315860, 1118481, 1118481, 1315860,
855309, 1184274, 1513239, 1315860, 1052688, 1118481, 1184274, 1513239, 1579032, 1381653, 1118481, 986895, 986895, 986895, 1052688, 1907997, 2302755, 1184274, 263172, 131586, 131586, 131586, 460551, 1973790, 2829099, 2171169, 1052688, 1184274, 1315860, 1381653, 1644825, 1644825, 1842204, 1250067, 986895, 1184274, 1052688, 1250067, 1513239, 1250067,
394758, 657930, 1644825, 1381653, 1315860, 1184274, 1184274, 1184274, 1315860, 1381653, 1052688, 1052688, 1052688, 1184274, 1118481, 1118481, 1052688, 328965, 131586, 197379, 131586, 131586, 197379, 592137, 2105376, 1710618, 1447446, 1184274, 1052688, 1250067, 1447446, 1579032, 1513239, 1513239, 1250067, 1513239, 1579032, 1513239, 1118481, 592137,
197379, 197379, 657930, 1381653, 1513239, 1315860, 1315860, 1250067, 789516, 855309, 1250067, 1250067, 1052688, 1513239, 1315860, 657930, 328965, 328965, 328965, 263172, 263172, 197379, 328965, 526344, 855309, 1513239, 1973790, 1710618, 1315860, 1579032, 1381653, 1184274, 1447446, 2368548, 1907997, 2105376, 2500134, 1644825, 657930, 131586,
197379, 131586, 131586, 657930, 1710618, 1776411, 1447446, 1052688, 855309, 855309, 921102, 1118481, 1579032, 1447446, 855309, 328965, 328965, 394758, 328965, 263172, 131586, 197379, 263172, 460551, 657930, 789516, 1710618, 2236962, 2105376, 1447446, 1250067, 1381653, 1776411, 2368548, 2631720, 3026478, 2236962, 789516, 263172, 131586,
197379, 197379, 131586, 197379, 1381653, 1973790, 1579032, 1184274, 1052688, 921102, 855309, 1052688, 1447446, 1052688, 328965, 131586, 328965, 460551, 460551, 328965, 131586, 263172, 197379, 328965, 460551, 460551, 921102, 2236962, 2105376, 1447446, 1118481, 1250067, 1513239, 2434341, 2302755, 2565927, 1052688, 131586, 131586, 131586,
197379, 131586, 131586, 131586, 328965, 1052688, 1447446, 1644825, 1250067, 1052688, 1184274, 1052688, 855309, 394758, 263172, 197379, 131586, 263172, 328965, 263172, 197379, 131586, 197379, 197379, 263172, 592137, 657930, 921102, 1118481, 1250067, 1118481, 1118481, 1710618, 1973790, 1250067, 855309, 263172, 131586, 197379, 131586,
};
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_BENCHMARK != 0*/

View File

@ -242,8 +242,8 @@
#define LV_APP_FILES_CHUNK_MAX_SIZE 1024 /*Max chunk size when the user sets it*/
#endif /*USE_LV_APP_FILES != 0*/
/*WiFi*/
#define USE_LV_APP_WIFI 1
/*WiFi (requires hal/wifi)*/
#define USE_LV_APP_WIFI 0
#if USE_LV_APP_WIFI != 0
#define LV_APP_WIFI_SSID_DEF "my_ssid"
#define LV_APP_WIFI_PWD_DEF "my_pasword"
@ -252,8 +252,8 @@
#define LV_APP_WIFI_AUTO_CONNECT 1 /*Try to connect at start up to the deafult SSID and IP:PORT*/
#endif /*USE_LV_APP_WIFI != 0*/
/*GSM*/
#define USE_LV_APP_GSM 1
/*GSM (requires hal/gsm)*/
#define USE_LV_APP_GSM 0
#if USE_LV_APP_GSM != 0
#define LV_APP_GSM_APN_DEF "my_apn"
#define LV_APP_GSM_IP_DEF "10.11.12.13"

View File

@ -126,7 +126,8 @@ typedef enum
LV_PROTECT_NONE = 0x00,
LV_PROTECT_CHILD_CHG = 0x01, /*Disable the child change signal. Used by the library*/
LV_PROTECT_PARENT = 0x02, /*Prevent automatic parent change (e.g. in lv_page)*/
LV_PROTECT_POS = 0x04, /*Prevent automatic positioning (e.g. in lv_rect layout)*/
LV_PROTECT_POS = 0x04, /*Prevent automatic positioning (e.g. in lv_cont layout)*/
LV_PROTECT_FOLLOW = 0x08, /*Prevent an object follow in automatic ordering (e.g. in lv_cont PRETTY layout)*/
}lv_protect_t;
typedef enum

View File

@ -438,17 +438,21 @@ static void lv_cont_layout_pretty(lv_obj_t * cont)
do {
if(lv_obj_get_hidden(child_rc) == false &&
lv_obj_is_protected(child_rc, LV_PROTECT_POS) == false) {
if(w_row + lv_obj_get_width(child_rc) > w_obj) break; /*If the next object is already not fit then break*/
if(w_row + lv_obj_get_width(child_rc) > w_obj) break; /*If this object is already not fit then break*/
w_row += lv_obj_get_width(child_rc) + style->opad; /*Add the object width + opad*/
h_row = MATH_MAX(h_row, lv_obj_get_height(child_rc)); /*Search the highest object*/
obj_num ++;
if(lv_obj_is_protected(child_rc, LV_PROTECT_FOLLOW)) break; /*If can not be followed by an other object then break here*/
}
child_rc = ll_get_prev(&cont->child_ll, child_rc); /*Load the next object*/
if(obj_num == 0) child_rs = child_rc; /*If the first object was hidden (or too long) then set the next as first */
}while(child_rc != NULL);
/*Step back one child because the last already not fit*/
if(child_rc != NULL && obj_num != 0) child_rc = ll_get_next(&cont->child_ll, child_rc);
/*Step back one child because the last already not fit (except follow protected)*/
if(child_rc != NULL && obj_num != 0 && !lv_obj_is_protected(child_rc, LV_PROTECT_FOLLOW)) {
child_rc = ll_get_next(&cont->child_ll, child_rc);
}
/*If the object is too long then align it to the middle*/
if(obj_num == 0) {