I need to create a complex button containing two rows, each with two labels and exact spacing between them.
The button looks good, just as I want it to look but the problem is that this button is clickable only on its edges.
It seems like the flex layout (generic object) does not inherit button’s ‘clickability’.
Adding: lv_obj_add_flag(div, LV_OBJ_FLAG_CLICKABLE); does not help.
What am I missing?
I think it is a bug. Report has been made #7451
LVGL rev: 9.3 dev
lv_obj_t* cont =lv_screen_active();
lv_obj_t* btn;
lv_obj_t* lbl;
lv_obj_t* div;
btn = lv_button_create(cont);
lv_obj_set_size(btn, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
lv_obj_set_flex_flow(btn, LV_FLEX_FLOW_COLUMN);
lv_obj_set_style_pad_row(btn, 10, 0);
// row 1
div = lv_obj_create(btn);
lv_obj_remove_style_all(div);
lv_obj_set_size(div, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
lv_obj_set_flex_flow(div, LV_FLEX_FLOW_ROW);
lv_obj_set_style_pad_column(div, 20, 0);
lbl = lv_label_create(div);
lv_label_set_text_fmt(lbl, "long long text");
lbl = lv_label_create(div);
lv_label_set_text_fmt(lbl, "short");
// row 2
div = lv_obj_create(btn);
lv_obj_remove_style_all(div);
lv_obj_set_size(div, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
lv_obj_set_flex_flow(div, LV_FLEX_FLOW_ROW);
lv_obj_set_style_pad_column(div, 20, 0);
lbl = lv_label_create(div);
lv_label_set_text_fmt(lbl, "medium 1");
lbl = lv_label_create(div);
lv_label_set_text_fmt(lbl, "medium 2");
