'lv_style_transp' was not declared in this scope

Hello guys,

I was testing a sample code I saw in github but I cannot manage to see where the lv_style_transp comes from, the snippet:

static void create_tab1(lv_obj_t * parent)
{
    lv_page_set_scrl_layout(parent, LV_LAYOUT_PRETTY_TOP);

    lv_theme_t * th = lv_theme_get_act();

    static lv_style_t h_style;
    lv_style_copy(&h_style, &lv_style_transp);
    h_style.body.padding.inner = LV_DPI / 10;
    h_style.body.padding.left = LV_DPI / 4;

I also tried to use the examples but none of them seem to be working, only the ones using tft_espi for the moment

Hi
This is one of the default styles that we have in lvgl ver 6. It was defined to make it easier to define a style. As you can see at first it copies all of its parameters into the h_style and then changes the ones we need.
By the way, take care, this is the way we config styles in ver 6. In order to use ver 7, we have a little bit different story. for more info refer to the documentation.

1 Like