chore(format) add formatting for examples & demos, merge test config
This commit is contained in:
@@ -17,11 +17,11 @@ static void float_btn_event_cb(lv_event_t * e)
|
||||
lv_obj_t * sub_page = lv_menu_page_create(menu, NULL);
|
||||
|
||||
cont = lv_menu_cont_create(sub_page);
|
||||
label= lv_label_create(cont);
|
||||
label = lv_label_create(cont);
|
||||
lv_label_set_text_fmt(label, "Hello, I am hiding inside %i", btn_cnt);
|
||||
|
||||
cont = lv_menu_cont_create(main_page);
|
||||
label= lv_label_create(cont);
|
||||
label = lv_label_create(cont);
|
||||
lv_label_set_text_fmt(label, "Item %i", btn_cnt);
|
||||
lv_menu_set_load_page_event(menu, cont, sub_page);
|
||||
|
||||
|
||||
@@ -11,11 +11,11 @@ static void back_event_handler(lv_event_t * e);
|
||||
static void switch_handler(lv_event_t * e);
|
||||
lv_obj_t * root_page;
|
||||
static lv_obj_t * create_text(lv_obj_t * parent, const char * icon, const char * txt,
|
||||
lv_menu_builder_variant_t builder_variant);
|
||||
lv_menu_builder_variant_t builder_variant);
|
||||
static lv_obj_t * create_slider(lv_obj_t * parent,
|
||||
const char * icon, const char * txt, int32_t min, int32_t max, int32_t val);
|
||||
const char * icon, const char * txt, int32_t min, int32_t max, int32_t val);
|
||||
static lv_obj_t * create_switch(lv_obj_t * parent,
|
||||
const char * icon, const char * txt, bool chk);
|
||||
const char * icon, const char * txt, bool chk);
|
||||
|
||||
void lv_example_menu_5(void)
|
||||
{
|
||||
@@ -24,7 +24,8 @@ void lv_example_menu_5(void)
|
||||
lv_color_t bg_color = lv_obj_get_style_bg_color(menu, 0);
|
||||
if(lv_color_brightness(bg_color) > 127) {
|
||||
lv_obj_set_style_bg_color(menu, lv_color_darken(lv_obj_get_style_bg_color(menu, 0), 10), 0);
|
||||
}else{
|
||||
}
|
||||
else {
|
||||
lv_obj_set_style_bg_color(menu, lv_color_darken(lv_obj_get_style_bg_color(menu, 0), 50), 0);
|
||||
}
|
||||
lv_menu_set_mode_root_back_btn(menu, LV_MENU_ROOT_BACK_BTN_ENABLED);
|
||||
@@ -64,8 +65,10 @@ void lv_example_menu_5(void)
|
||||
lv_obj_t * sub_legal_info_page = lv_menu_page_create(menu, NULL);
|
||||
lv_obj_set_style_pad_hor(sub_legal_info_page, lv_obj_get_style_pad_left(lv_menu_get_main_header(menu), 0), 0);
|
||||
section = lv_menu_section_create(sub_legal_info_page);
|
||||
for(uint32_t i=0; i<15; i++){
|
||||
create_text(section, NULL, "This is a long long long long long long long long long text, if it is long enough it may scroll.", LV_MENU_ITEM_BUILDER_VARIANT_1);
|
||||
for(uint32_t i = 0; i < 15; i++) {
|
||||
create_text(section, NULL,
|
||||
"This is a long long long long long long long long long text, if it is long enough it may scroll.",
|
||||
LV_MENU_ITEM_BUILDER_VARIANT_1);
|
||||
}
|
||||
|
||||
lv_obj_t * sub_about_page = lv_menu_page_create(menu, NULL);
|
||||
@@ -128,7 +131,8 @@ static void switch_handler(lv_event_t * e)
|
||||
lv_menu_set_page(menu, NULL);
|
||||
lv_menu_set_sidebar_page(menu, root_page);
|
||||
lv_event_send(lv_obj_get_child(lv_obj_get_child(lv_menu_get_cur_sidebar_page(menu), 0), 0), LV_EVENT_CLICKED, NULL);
|
||||
}else {
|
||||
}
|
||||
else {
|
||||
lv_menu_set_sidebar_page(menu, NULL);
|
||||
lv_menu_clear_history(menu); /* Clear history because we will be showing the root page later */
|
||||
lv_menu_set_page(menu, root_page);
|
||||
@@ -137,7 +141,7 @@ static void switch_handler(lv_event_t * e)
|
||||
}
|
||||
|
||||
static lv_obj_t * create_text(lv_obj_t * parent, const char * icon, const char * txt,
|
||||
lv_menu_builder_variant_t builder_variant)
|
||||
lv_menu_builder_variant_t builder_variant)
|
||||
{
|
||||
lv_obj_t * obj = lv_menu_cont_create(parent);
|
||||
|
||||
@@ -164,7 +168,8 @@ static lv_obj_t * create_text(lv_obj_t * parent, const char * icon, const char *
|
||||
return obj;
|
||||
}
|
||||
|
||||
static lv_obj_t * create_slider(lv_obj_t * parent, const char * icon, const char * txt, int32_t min, int32_t max, int32_t val)
|
||||
static lv_obj_t * create_slider(lv_obj_t * parent, const char * icon, const char * txt, int32_t min, int32_t max,
|
||||
int32_t val)
|
||||
{
|
||||
lv_obj_t * obj = create_text(parent, icon, txt, LV_MENU_ITEM_BUILDER_VARIANT_2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user