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:
parent
a2e4dfdce2
commit
c2b0343431
@ -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_size(obj, LV_PCT(100), LV_SIZE_CONTENT);
|
||||||
lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW);
|
lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW);
|
||||||
|
|
||||||
|
#if LV_USE_IMG == 1
|
||||||
if(icon) {
|
if(icon) {
|
||||||
lv_obj_t * img = lv_img_create(obj);
|
lv_obj_t * img = lv_img_create(obj);
|
||||||
lv_img_set_src(img, icon);
|
lv_img_set_src(img, icon);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if(txt) {
|
if(txt) {
|
||||||
lv_obj_t * label = lv_label_create(obj);
|
lv_obj_t * label = lv_label_create(obj);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user