How to configure LVGL styles? Can it be done in the prj.conf?

I got the Zephyr lvgl example working, but the background was white and font was small. I know I can use lv_style_t but can't I see things like CONFIG_LV_FONT_MONTSERRAT_28=y in prj.conf, is there a way to set the background from there and set the default font from there?

Parents
  • Hi

    You can find all the config parameters for lvgl in the main Kconfig file of the library here.

    There is a config called LV_FONT_DEFAULT that you can use to set the default font, allowing you to provide the name of one of the built in fonts. 

    I don't believe there is any way to set the default background unfortunately. You can create application level config parameters if you create a Kconfig file in your project root directory (the same folder where the CMakeLists.txt file can be located), but then you need to create some code in your application to read and apply this configuration during project startup. 

    Best regards
    Torbjørn

  • Thank you. That worked. I used this to set the background:

    lv_obj_set_style_bg_color(lv_scr_act(), lv_color_black(), LV_PART_MAIN);
    I have been running into other problems with prj.conf however, but this did answer my question and the Kconfig file gives me something which might help with my other problem.
Reply Children
Related