From 2dc9c37eb202a81a7b00ea4f5dad04c77937e779 Mon Sep 17 00:00:00 2001 From: GoT Date: Tue, 6 Feb 2024 11:55:29 +0100 Subject: [PATCH] fix(doc): wrong code for Displays transparency (#5607) --- docs/overview/display.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/overview/display.rst b/docs/overview/display.rst index dbdeee86e..2b4d6d0ce 100644 --- a/docs/overview/display.rst +++ b/docs/overview/display.rst @@ -118,11 +118,11 @@ In summary, to enable transparent screens and displays for OSD menu-like UIs: - Set the screen's ``bg_opa`` to transparent: - :cpp:expr:`lv_obj_set_style_bg_opa(lv_screen_active(), LV_OPA_TRANSP, 0)` + :cpp:expr:`lv_obj_set_style_bg_opa(lv_screen_active(), LV_OPA_TRANSP, LV_PART_MAIN)` - Set the bottom layer's ``bg_opa`` to transparent: - :cpp:expr:`lv_obj_set_style_bg_opa(lv_screen_active(), LV_OPA_TRANSP, 0)` -- Set the screen's bg_opa to 0: - :cpp:expr:`lv_obj_set_style_bg_opa(lv_layer_bottom(), LV_OPA_TRANSP, 0)` + :cpp:expr:`lv_obj_set_style_bg_opa(lv_layer_bottom(), LV_OPA_TRANSP, LV_PART_MAIN)` +- Set the screen's ``bg_opa`` to 0: + :cpp:expr:`lv_obj_set_style_bg_opa(lv_screen_active(), LV_OPA_0, LV_PART_MAIN)` - Set a color format with alpha channel. E.g. :cpp:expr:`lv_display_set_color_format(disp, LV_COLOR_FORMAT_ARGB8888)`