Embedded SDK
Embedded SDK
ux_layout_bn.c
Go to the documentation of this file.
1 
2 /*******************************************************************************
3  * Ledger Nano S - Secure firmware
4  * (c) 2022 Ledger
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  ********************************************************************************/
18 
19 #include "ux.h"
20 #include "ux_layout_common.h"
21 
22 #ifdef HAVE_UX_FLOW
23 
24 /*********************************************************************************
25  * 1 bold text line
26  * 1 text lines
27  * Uses layout from ux_layout_bb
28  */
29 
30 const bagl_element_t *ux_layout_bn_prepro(const bagl_element_t *element)
31 {
32  const bagl_element_t *e = ux_layout_strings_prepro(element);
33  if (e && G_ux.tmp_element.component.userid == 0x11) {
34  G_ux.tmp_element.component.font_id
35  = BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER;
36  }
37  return e;
38 }
39 
40 void ux_layout_bn_init(unsigned int stack_slot)
41 {
42  ux_layout_bb_init_common(stack_slot);
43  G_ux.stack[stack_slot].screen_before_element_display_callback = ux_layout_bn_prepro;
44  ux_stack_display(stack_slot);
45 }
46 
47 #endif // HAVE_UX_FLOW
const bagl_element_t * ux_layout_strings_prepro(const bagl_element_t *element)
#define G_ux
Definition: ux_bagl.h:345
void ux_stack_display(unsigned int stack_slot)
Definition: ux_stack.c:331