From 1573a8c4cde1cd9528b422b2dcc598e37ffe94a7 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 2 May 2024 19:12:26 +1000 Subject: WIP merge cyclically dependent components into one big component --- src/tangara/ui/screen_splash.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/tangara/ui/screen_splash.cpp (limited to 'src/tangara/ui/screen_splash.cpp') diff --git a/src/tangara/ui/screen_splash.cpp b/src/tangara/ui/screen_splash.cpp new file mode 100644 index 00000000..48cfef88 --- /dev/null +++ b/src/tangara/ui/screen_splash.cpp @@ -0,0 +1,33 @@ +/* + * Copyright 2023 jacqueline + * + * SPDX-License-Identifier: GPL-3.0-only + */ + +#include "screen_splash.hpp" + +#include "core/lv_obj.h" +#include "core/lv_obj_style.h" +#include "lvgl.h" +#include "misc/lv_area.h" +#include "misc/lv_color.h" +#include "misc/lv_style.h" + +LV_IMG_DECLARE(splash); + +namespace ui { +namespace screens { + +Splash::Splash() { + lv_obj_set_style_bg_opa(root_, LV_OPA_COVER, 0); + lv_obj_set_style_bg_color(root_, lv_color_black(), 0); + + lv_obj_t* logo = lv_img_create(root_); + lv_img_set_src(logo, &splash); + lv_obj_center(logo); +} + +Splash::~Splash() {} + +} // namespace screens +} // namespace ui -- cgit v1.2.3