Why lv_img cant be made CHECKABLE?


lv_img extends the base lv_obj and the main purpose is to render an image in the draw event, however why it did not inherit the checkable functionality from its parent? I have a need for quite a complex button and I found the quickest way to reproduce it in lvgl is by using lv_img and utilizing a combination of its background image part for the shape and the normal part for whats on top. Lack of checkability is a major roadblock for me, which I had to get around using extra invisible lv_obj on top to receive input and hold the state.

Ok, so I dug into the source code and the lv_img constructor clears the flag CLICKABLE, so flag CHECKABLE has no effect. I managed to get the image checkable by adding this:

lv_obj_add_flag(my_img, LV_OBJ_FLAG_CLICKABLE);
lv_obj_add_flag(my_img, LV_OBJ_FLAG_CHECKABLE);
lv_obj_clear_flag(my_img, LV_OBJ_FLAG_ADV_HITTEST);