Merge pull request #13568 from s-hadinger/lvgl_screen_bg

LVGL set screen background to black
This commit is contained in:
s-hadinger 2021-11-04 20:20:13 +01:00 committed by GitHub
commit 14165e8d92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -401,6 +401,9 @@ void start_lvgl(const char * uconfig) {
// Set the default background color of the display
// This is normally overriden by an opaque screen on top
#ifdef USE_BERRY
// By default set the display color to black and opacity to 100%
lv_disp_set_bg_color(NULL, lv_color_from_uint32(USE_LVGL_BG_DEFAULT));
lv_disp_set_bg_opa(NULL, LV_OPA_COVER);
lv_obj_set_style_bg_color(lv_scr_act(), lv_color_from_uint32(USE_LVGL_BG_DEFAULT), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_COVER, LV_PART_MAIN | LV_STATE_DEFAULT);