LVGL set screen background to black

This commit is contained in:
Stephan Hadinger 2021-11-04 19:31:43 +01:00
parent aa79f73aa9
commit 1f2a5a913b
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 // Set the default background color of the display
// This is normally overriden by an opaque screen on top // This is normally overriden by an opaque screen on top
#ifdef USE_BERRY #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_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); lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_COVER, LV_PART_MAIN | LV_STATE_DEFAULT);