Commit f25a8aaf authored by Fabian Blatz's avatar Fabian Blatz Committed by Benjamin Cabé
Browse files

samples: modules: lvgl: transparency: Migrate to v9.2

Removes the LV_COLOR_SCREEN_TRANSP Kconfig option as its not part of the
modules Kconfig anymore and renames the functions according to the new v9.2
API.

Signed-off-by: default avatarFabian Blatz <fabianblatz@gmail.com>
parent 472caa96
Loading
Loading
Loading
Loading
+0 −1
Changes for samples/modules/lvgl/screen_transparency/prj.conf: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -4,6 +4,5 @@ CONFIG_LOG=y
CONFIG_LVGL=y
CONFIG_LV_Z_MEM_POOL_SIZE=16384
CONFIG_LV_COLOR_DEPTH_32=y
CONFIG_LV_COLOR_SCREEN_TRANSP=y

CONFIG_DISPLAY=y
+6 −7
Changes for samples/modules/lvgl/screen_transparency/src/main.c: 6 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -21,14 +21,13 @@ static void initialize_gui(void)
	lv_obj_t *label;

	/* Configure screen and background for transparency */
	lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_TRANSP, LV_PART_MAIN);
	lv_disp_set_bg_opa(NULL, LV_OPA_TRANSP);
	lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x000000), LV_PART_MAIN);
	lv_obj_set_style_bg_opa(lv_screen_active(), LV_OPA_TRANSP, LV_PART_MAIN);
	lv_obj_set_style_bg_opa(lv_layer_bottom(), LV_OPA_TRANSP, LV_PART_MAIN);

	/* Create a label, set its text and align it to the center */
	label = lv_label_create(lv_scr_act());
	label = lv_label_create(lv_screen_active());
	lv_label_set_text(label, "Hello, world!");
	lv_obj_set_style_text_color(lv_scr_act(), lv_color_hex(0xff00ff), LV_PART_MAIN);
	lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0xff00ff), LV_PART_MAIN);
	lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
}

@@ -60,11 +59,11 @@ int main(void)

	initialize_gui();

	lv_task_handler();
	lv_timer_handler();
	display_blanking_off(display_dev);

	while (1) {
		uint32_t sleep_ms = lv_task_handler();
		uint32_t sleep_ms = lv_timer_handler();

		k_msleep(MIN(sleep_ms, INT32_MAX));
	}