@@ -52,6 +52,7 @@ component_t* waiting_create(void)
5252 Abort ("Error: malloc waiting data" );
5353 }
5454 memset (data , 0 , sizeof (data_t ));
55+ data -> show_logo = true;
5556
5657 component_t * waiting = malloc (sizeof (component_t ));
5758 if (!waiting ) {
@@ -65,7 +66,16 @@ component_t* waiting_create(void)
6566 waiting -> position .left = 0 ;
6667 waiting -> data = data ;
6768
68- ui_util_add_sub_component (waiting , lockscreen_create ());
69+ image_logo_data_t logo = image_logo_data ();
70+ component_t * bb2_logo = image_create (
71+ logo .buffer .data ,
72+ logo .buffer .len ,
73+ logo .dimensions .width ,
74+ logo .dimensions .height ,
75+ CENTER ,
76+ waiting );
77+
78+ ui_util_add_sub_component (waiting , bb2_logo );
6979
7080 return waiting ;
7181}
@@ -97,3 +107,22 @@ void waiting_switch_to_logo(component_t* component)
97107
98108 component -> sub_components .sub_components [0 ] = bb2_logo ;
99109}
110+
111+ void waiting_switch_to_lockscreen (component_t * component )
112+ {
113+ data_t * data = (data_t * )component -> data ;
114+ if (!data -> show_logo ) {
115+ return ;
116+ }
117+ data -> show_logo = false;
118+
119+ if (component -> sub_components .amount != 1 ) {
120+ // Sanity check to avoid memory bugs, should never happen.
121+ Abort ("waiting_switch_to_lockscreen" );
122+ return ;
123+ }
124+
125+ ui_util_component_cleanup (component -> sub_components .sub_components [0 ]);
126+
127+ component -> sub_components .sub_components [0 ] = lockscreen_create ();
128+ }
0 commit comments