refactor(btn, img): rename btn to button and img to image
This commit is contained in:
@@ -5,7 +5,7 @@ static uint32_t btn_cnt = 1;
|
||||
static lv_obj_t * main_page;
|
||||
static lv_obj_t * menu;
|
||||
|
||||
static void float_btn_event_cb(lv_event_t * e)
|
||||
static void float_button_event_cb(lv_event_t * e)
|
||||
{
|
||||
LV_UNUSED(e);
|
||||
|
||||
@@ -56,13 +56,13 @@ void lv_example_menu_4(void)
|
||||
lv_menu_set_page(menu, main_page);
|
||||
|
||||
/*Create floating btn*/
|
||||
lv_obj_t * float_btn = lv_btn_create(lv_scr_act());
|
||||
lv_obj_t * float_btn = lv_button_create(lv_scr_act());
|
||||
lv_obj_set_size(float_btn, 50, 50);
|
||||
lv_obj_add_flag(float_btn, LV_OBJ_FLAG_FLOATING);
|
||||
lv_obj_align(float_btn, LV_ALIGN_BOTTOM_RIGHT, -10, -10);
|
||||
lv_obj_add_event(float_btn, float_btn_event_cb, LV_EVENT_CLICKED, menu);
|
||||
lv_obj_add_event(float_btn, float_button_event_cb, LV_EVENT_CLICKED, menu);
|
||||
lv_obj_set_style_radius(float_btn, LV_RADIUS_CIRCLE, 0);
|
||||
lv_obj_set_style_bg_img_src(float_btn, LV_SYMBOL_PLUS, 0);
|
||||
lv_obj_set_style_bg_image_src(float_btn, LV_SYMBOL_PLUS, 0);
|
||||
lv_obj_set_style_text_font(float_btn, lv_theme_get_font_large(float_btn), 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user