55 */
66#include "ui_wallpaper.h"
77
8- #include "assets/assets.h"
9-
108ui_wallpaper_t * ui_wallpaper_attach (lv_obj_t * parent )
119{
1210 if (parent == NULL )
@@ -32,23 +30,10 @@ ui_wallpaper_t* ui_wallpaper_attach(lv_obj_t* parent)
3230 lv_obj_set_size (wallpaper -> layer , LV_PCT (100 ), LV_PCT (100 ));
3331 lv_obj_add_flag (wallpaper -> layer , LV_OBJ_FLAG_IGNORE_LAYOUT );
3432 lv_obj_move_background (wallpaper -> layer );
35- lv_obj_set_style_bg_opa (wallpaper -> layer , LV_OPA_TRANSP , LV_PART_MAIN );
33+ lv_obj_set_style_bg_color (wallpaper -> layer , lv_color_white (), LV_PART_MAIN );
34+ lv_obj_set_style_bg_opa (wallpaper -> layer , LV_OPA_COVER , LV_PART_MAIN );
3635 lv_obj_set_style_border_width (wallpaper -> layer , 0 , LV_PART_MAIN );
3736
38- wallpaper -> image = lv_image_create (wallpaper -> layer );
39- if (wallpaper -> image == NULL )
40- {
41- lv_obj_del (wallpaper -> layer );
42- lv_free (wallpaper );
43- return NULL ;
44- }
45-
46- lv_obj_remove_style_all (wallpaper -> image );
47- lv_image_set_src (wallpaper -> image , & launcher_bg );
48- lv_obj_set_align (wallpaper -> image , LV_ALIGN_CENTER );
49- lv_obj_add_flag (wallpaper -> image , LV_OBJ_FLAG_IGNORE_LAYOUT );
50- lv_obj_move_background (wallpaper -> image );
51-
5237 return wallpaper ;
5338}
5439
@@ -59,12 +44,6 @@ void ui_wallpaper_detach(ui_wallpaper_t* wallpaper)
5944 return ;
6045 }
6146
62- if (wallpaper -> image != NULL )
63- {
64- lv_obj_del (wallpaper -> image );
65- wallpaper -> image = NULL ;
66- }
67-
6847 if (wallpaper -> layer != NULL )
6948 {
7049 lv_obj_del (wallpaper -> layer );
0 commit comments