lvgl: Missing LV_STYLE_CONST_FLEX_*

Perform all steps below and tick them with [x]

  • Read the FAQ
  • Check the related part of the Documentation
  • Update lvgl to the latest version
  • Reproduce the issue in a Simulator

Describe the bug

The const style defines for the flex layout are missing and should be added. I believe also those from the grid layout are missing

Expected behavior

Add the flex const style defines:

#define LV_STYLE_CONST_FLEX_FLOW(val) \
{ \
    .prop = LV_STYLE_FLEX_FLOW, .value = { .num = (int32_t)val } \
}

#define LV_STYLE_CONST_FLEX_MAIN_PLACE(val) \
{ \
    .prop = LV_STYLE_FLEX_MAIN_PLACE, .value = { .num = (int32_t)val } \
}

#define LV_STYLE_CONST_FLEX_TRACK_PLACE(val) \
{ \
    .prop = LV_STYLE_FLEX_TRACK_PLACE, .value = { .num = (int32_t)val } \
}

#define LV_STYLE_CONST_FLEX_CROSS_PLACE(val) \
{ \
    .prop = LV_STYLE_FLEX_CROSS_PLACE, .value = { .num = (int32_t)val } \
}

#define LV_STYLE_CONST_FLEX_GROW(val) \
{ \
    .prop = LV_STYLE_FLEX_GROW, .value = { .num = (int32_t)val } \
}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Hi I won’t have time to do that before my vacation. There is another issue though after adding them manually is that LV_LAYOUT_FLEX, LV_FLEX_FLOW_ROW, etc are initialized in the module. So it doesn’t work when I make the style a constant at compile time.

Shouldn’t those values be something constant at compile time?

uint32_t LV_LAYOUT_FLEX;
lv_style_prop_t LV_STYLE_FLEX_FLOW;
lv_style_prop_t LV_STYLE_FLEX_MAIN_PLACE;
lv_style_prop_t LV_STYLE_FLEX_CROSS_PLACE;
lv_style_prop_t LV_STYLE_FLEX_TRACK_PLACE;
lv_style_prop_t LV_STYLE_FLEX_GROW;

void lv_flex_init(void)
{
    LV_LAYOUT_FLEX = lv_layout_register(flex_update, NULL);

    LV_STYLE_FLEX_FLOW = lv_style_register_prop();
    LV_STYLE_FLEX_MAIN_PLACE = lv_style_register_prop() | LV_STYLE_PROP_LAYOUT_REFR;
    LV_STYLE_FLEX_CROSS_PLACE = lv_style_register_prop() | LV_STYLE_PROP_LAYOUT_REFR;
    LV_STYLE_FLEX_TRACK_PLACE = lv_style_register_prop() | LV_STYLE_PROP_LAYOUT_REFR;
}