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

fix(list) guard image creation with LV_USE_IMG (#2881)

This commit is contained in:
SgtPepper 2021-12-09 15:47:21 +01:00 committed by GitHub
parent a2e4dfdce2
commit c2b0343431
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,10 +81,12 @@ lv_obj_t * lv_list_add_btn(lv_obj_t * list, const char * icon, const char * txt)
lv_obj_set_size(obj, LV_PCT(100), LV_SIZE_CONTENT);
lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW);
#if LV_USE_IMG == 1
if(icon) {
lv_obj_t * img = lv_img_create(obj);
lv_img_set_src(img, icon);
}
#endif
if(txt) {
lv_obj_t * label = lv_label_create(obj);