23#include "os_io_seph_ux.h"
25#include "os_helpers.h"
32#define INTERNAL_SPACE 16
34#define INNER_MARGIN 12
36#define NB_MAX_LAYOUTS 3
39#define NB_MAX_CONTAINER_CHILDREN 20
41#define TAG_VALUE_ICON_WIDTH 32
43#if defined(TARGET_STAX)
44#define RADIO_CHOICE_HEIGHT 96
45#define BAR_INTERVALE 12
46#define FOOTER_BUTTON_HEIGHT 128
47#define FOOTER_IN_PAIR_HEIGHT 80
48#define ROUNDED_AND_FOOTER_FOOTER_HEIGHT 192
49#define FOOTER_TEXT_AND_NAV_WIDTH 160
50#define TAP_TO_CONTINUE_MARGIN 24
51#define SUB_HEADER_MARGIN 24
52#define PRE_FIRST_TEXT_MARGIN 24
53#define INTER_PARAGRAPHS_MARGIN 40
54#define PRE_TITLE_MARGIN 24
55#define PRE_DESCRIPTION_MARGIN 16
56#define PRE_FIRST_ROW_MARGIN 32
57#define INTER_ROWS_MARGIN 16
58#define QR_PRE_TEXT_MARGIN 24
59#define QR_INTER_TEXTS_MARGIN 40
60#define SPINNER_TEXT_MARGIN 20
61#define SPINNER_INTER_TEXTS_MARGIN 20
62#define BAR_TEXT_MARGIN 24
63#define BAR_INTER_TEXTS_MARGIN 16
64#define LEFT_CONTENT_TEXT_PADDING 0
65#define BUTTON_FROM_BOTTOM_MARGIN 4
66#define TOP_BUTTON_MARGIN VERTICAL_BORDER_MARGIN
67#define TOP_BUTTON_MARGIN_WITH_ACTION VERTICAL_BORDER_MARGIN
68#define SINGLE_BUTTON_MARGIN 24
69#define LONG_PRESS_PROGRESS_HEIGHT 8
70#define LONG_PRESS_PROGRESS_ALIGN 4
71#define TITLE_DESC_MARGIN 16
72#define LEFT_CONTENT_ICON_TEXT_X 16
73#define TIP_BOX_MARGIN_Y 24
74#elif defined(TARGET_FLEX)
75#define RADIO_CHOICE_HEIGHT 92
76#define BAR_INTERVALE 16
77#define FOOTER_BUTTON_HEIGHT 136
78#define FOOTER_IN_PAIR_HEIGHT 88
79#define ROUNDED_AND_FOOTER_FOOTER_HEIGHT 208
80#define FOOTER_TEXT_AND_NAV_WIDTH 192
81#define TAP_TO_CONTINUE_MARGIN 30
82#define SUB_HEADER_MARGIN 28
83#define PRE_FIRST_TEXT_MARGIN 0
84#define INTER_PARAGRAPHS_MARGIN 24
85#define PRE_TITLE_MARGIN 16
86#define PRE_DESCRIPTION_MARGIN 24
87#define PRE_FIRST_ROW_MARGIN 32
88#define INTER_ROWS_MARGIN 24
89#define QR_PRE_TEXT_MARGIN 24
90#define QR_INTER_TEXTS_MARGIN 28
91#define SPINNER_TEXT_MARGIN 24
92#define SPINNER_INTER_TEXTS_MARGIN 16
93#define BAR_TEXT_MARGIN 24
94#define BAR_INTER_TEXTS_MARGIN 16
95#define LEFT_CONTENT_TEXT_PADDING 4
96#define BUTTON_FROM_BOTTOM_MARGIN 4
97#define TOP_BUTTON_MARGIN VERTICAL_BORDER_MARGIN
98#define TOP_BUTTON_MARGIN_WITH_ACTION VERTICAL_BORDER_MARGIN
99#define SINGLE_BUTTON_MARGIN 24
100#define LONG_PRESS_PROGRESS_HEIGHT 8
101#define LONG_PRESS_PROGRESS_ALIGN 4
102#define TITLE_DESC_MARGIN 16
103#define LEFT_CONTENT_ICON_TEXT_X 16
104#define TIP_BOX_MARGIN_Y 24
105#elif defined(TARGET_APEX)
106#define RADIO_CHOICE_HEIGHT 68
107#define BAR_INTERVALE 8
108#define FOOTER_BUTTON_HEIGHT 72
109#define FOOTER_IN_PAIR_HEIGHT 60
110#define ROUNDED_AND_FOOTER_FOOTER_HEIGHT 128
111#define FOOTER_TEXT_AND_NAV_WIDTH 120
112#define TAP_TO_CONTINUE_MARGIN 30
113#define SUB_HEADER_MARGIN 16
114#define PRE_FIRST_TEXT_MARGIN 0
115#define INTER_PARAGRAPHS_MARGIN 16
116#define PRE_TITLE_MARGIN 16
117#define PRE_DESCRIPTION_MARGIN 12
118#define PRE_FIRST_ROW_MARGIN 24
119#define INTER_ROWS_MARGIN 12
120#define QR_PRE_TEXT_MARGIN 16
121#define QR_INTER_TEXTS_MARGIN 20
122#define SPINNER_TEXT_MARGIN 16
123#define SPINNER_INTER_TEXTS_MARGIN 16
124#define BAR_TEXT_MARGIN 16
125#define BAR_INTER_TEXTS_MARGIN 12
126#define LEFT_CONTENT_TEXT_PADDING 4
127#define BUTTON_FROM_BOTTOM_MARGIN 0
128#define TOP_BUTTON_MARGIN 12
129#define TOP_BUTTON_MARGIN_WITH_ACTION 0
130#define SINGLE_BUTTON_MARGIN 16
131#define LONG_PRESS_PROGRESS_HEIGHT 4
132#define LONG_PRESS_PROGRESS_ALIGN 4
133#define TITLE_DESC_MARGIN 12
134#define LEFT_CONTENT_ICON_TEXT_X 8
135#define TIP_BOX_MARGIN_Y 12
137#error Undefined target
141#define SPINNER_REFRESH_PERIOD 400
185static uint8_t nbTouchableControls = 0;
192#ifdef HAVE_FAST_HOLD_TO_APPROVE
194#define HOLD_TO_APPROVE_STEP_PERCENT (7)
198#define HOLD_TO_APPROVE_STEP_DURATION_MS (100)
200#define HOLD_TO_APPROVE_STEP_PERCENT (25)
201#define HOLD_TO_APPROVE_STEP_DURATION_MS (400)
204static inline uint8_t get_hold_to_approve_percent(uint32_t touch_duration)
206#ifdef HAVE_FAST_HOLD_TO_APPROVE
215static bool getLayoutAndLayoutObj(
nbgl_obj_t *obj,
225 if (gLayout[i].nbChildren > 0) {
230 if (obj == gLayout[i].callbackObjPool[j].obj) {
232 "getLayoutAndLayoutObj(): obj found in layout[%d], index = %d, "
233 "nbUsedCallbackObjs = %d\n",
236 gLayout[i].nbUsedCallbackObjs);
237 *layout = &gLayout[i];
248static void radioTouchCallback(
nbgl_obj_t *obj,
261 bool needRefresh =
false;
267 if (getLayoutAndLayoutObj(obj, &layout, &layoutObj) ==
false) {
269 if (getLayoutAndLayoutObj(obj->parent, &layout, &layoutObj) ==
false) {
272 "touchCallback(): eventType = %d, obj = %p, no active layout or obj not found\n",
290 layoutObj->
index = eventType;
339 layoutObj->
index = lSwitch->state;
345 radioTouchCallback(obj, eventType, layout);
352 longTouchCallback(obj, eventType, layout, layoutObj);
357#ifdef HAVE_PIEZO_SOUND
359 os_io_seph_cmd_piezo_play_tune(layoutObj->
tuneId);
380 "longTouchCallback(): eventType = %d, obj = %p, gLayout[1].nbChildren = %d\n",
383 gLayout[1].nbChildren);
390 uint8_t new_state = get_hold_to_approve_percent(touchDuration);
394 bool trigger_callback = (new_state >= 100) && (progressBar->state < 100);
397 if (new_state >= 100) {
402 if (new_state != progressBar->state) {
403 progressBar->partialRedraw =
true;
404 progressBar->state = new_state;
413 if (trigger_callback) {
424 progressBar->partialRedraw =
true;
425 progressBar->state = 0;
437static void radioTouchCallback(
nbgl_obj_t *obj,
441 uint8_t i =
NB_MAX_LAYOUTS, radioIndex = 0, foundRadio = 0xFF, foundRadioIndex;
449 while (i < layout->nbUsedCallbackObjs) {
459 foundRadioIndex = radioIndex;
461 textArea->textColor =
BLACK;
462 textArea->fontId = SMALL_BOLD_FONT;
484 textArea->fontId = SMALL_REGULAR_FONT;
492 if (foundRadio != 0xFF) {
494#ifdef HAVE_PIEZO_SOUND
506static void spinnerTickerCallback(
void)
513 if (gLayout[1].nbChildren > 0) {
514 layout = &gLayout[1];
517 layout = &gLayout[0];
521 while (i < layout->container->nbChildren) {
524 if (container->nbChildren && (container->children[0]->type ==
SPINNER)) {
529 spinner->position = 0;
541static void animTickerCallback(
void)
548 if (gLayout[1].nbChildren > 0) {
549 layout = &gLayout[1];
552 layout = &gLayout[0];
560 while (i < layout->container->nbChildren) {
563 if (container->children[1]->type ==
IMAGE) {
602static nbgl_line_t *createHorizontalLine(uint8_t layer)
608 line->obj.area.width = SCREEN_WIDTH;
609 line->obj.area.height = 1;
616static nbgl_line_t *createLeftVerticalLine(uint8_t layer)
622 line->obj.area.width = 1;
623 line->obj.area.height = SCREEN_HEIGHT;
643 layoutObj->
obj = obj;
644 layoutObj->
token = token;
645 layoutObj->
tuneId = tuneId;
694 layoutInt->
container->obj.touchMask = swipesMask;
732 container->nbChildren = 0;
735 container->obj.area.height
736 = LIST_ITEM_MIN_TEXT_HEIGHT
737 + 2 * (itemDesc->
large ? LIST_ITEM_PRE_HEADING_LARGE : LIST_ITEM_PRE_HEADING);
739 container->obj.alignmentMarginX = BORDER_MARGIN;
741 container->obj.alignTo = NULL;
746 container->obj.touchMask = (1 <<
TOUCHED);
747 container->obj.touchId =
CONTROLS_ID + nbTouchableControls;
748 nbTouchableControls++;
752 if (itemDesc->
text != NULL) {
754 textArea->textColor = color;
755 textArea->text = PIC(itemDesc->
text);
756 textArea->onDrawCallback = NULL;
757 textArea->fontId = fontId;
758 textArea->wrapping =
true;
759 textArea->obj.area.width = container->obj.area.width;
762 textArea->obj.area.width
767 textArea->obj.area.width
771 textArea->obj.area.width -= SWITCH_ICON.width + BAR_INTERVALE;
773 textArea->obj.area.height =
MAX(
774 LIST_ITEM_MIN_TEXT_HEIGHT,
776 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping));
779 textArea->obj.alignmentMarginY
780 = itemDesc->
large ? LIST_ITEM_PRE_HEADING_LARGE : LIST_ITEM_PRE_HEADING;
781 if (textArea->obj.area.height > LIST_ITEM_MIN_TEXT_HEIGHT) {
782 textArea->obj.alignmentMarginY
783 -= (textArea->obj.area.height - LIST_ITEM_MIN_TEXT_HEIGHT) / 2;
786 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
787 container->nbChildren++;
793 imageLeft->foregroundColor = color;
794 imageLeft->buffer = PIC(itemDesc->
iconLeft);
796 imageLeft->obj.alignment =
MID_LEFT;
797 imageLeft->obj.alignTo = (
nbgl_obj_t *) textArea;
798 imageLeft->obj.alignmentMarginX = BAR_INTERVALE;
799 container->children[container->nbChildren] = (
nbgl_obj_t *) imageLeft;
800 container->nbChildren++;
802 if (textArea != NULL) {
803 textArea->obj.alignmentMarginX = imageLeft->buffer->width + BAR_INTERVALE;
809 imageRight->foregroundColor = color;
810 imageRight->buffer = PIC(itemDesc->
iconRight);
813 imageRight->obj.alignmentMarginX = BAR_INTERVALE;
814 imageRight->obj.alignTo = (
nbgl_obj_t *) textArea;
816 container->children[container->nbChildren] = (
nbgl_obj_t *) imageRight;
817 container->nbChildren++;
821 switchObj->onColor =
BLACK;
823 switchObj->state = itemDesc->
state;
825 switchObj->obj.alignmentMarginX = BAR_INTERVALE;
826 switchObj->obj.alignTo = (
nbgl_obj_t *) textArea;
828 container->children[container->nbChildren] = (
nbgl_obj_t *) switchObj;
829 container->nbChildren++;
832 if (itemDesc->
subText != NULL) {
836 subTextArea->textColor = color;
837 subTextArea->text = PIC(itemDesc->
subText);
838 subTextArea->textAlignment =
MID_LEFT;
839 subTextArea->fontId = SMALL_REGULAR_FONT;
841 subTextArea->wrapping =
true;
842 if (itemDesc->
text != NULL) {
844 subTextArea->obj.alignTo = (
nbgl_obj_t *) textArea;
845 subTextArea->obj.alignmentMarginY = LIST_ITEM_HEADING_SUB_TEXT;
848 subTextArea->obj.alignment =
TOP_LEFT;
849 subTextArea->obj.alignmentMarginY = SUB_HEADER_MARGIN;
850 container->obj.area.height = SUB_HEADER_MARGIN;
853 subTextArea->obj.alignmentMarginX
856 subTextArea->obj.area.width = container->obj.area.width;
859 subTextArea->obj.area.width,
860 subTextArea->wrapping);
861 container->children[container->nbChildren] = (
nbgl_obj_t *) subTextArea;
862 container->nbChildren++;
863 container->obj.area.height
864 += subTextArea->obj.area.height + subTextArea->obj.alignmentMarginY;
886 uint16_t fullHeight = 0;
891 container->nbChildren = 0;
896 if (info->
icon != NULL) {
899 image->buffer = PIC(info->
icon);
901 image->obj.alignmentMarginY = info->
iconHug;
903 fullHeight += image->buffer->height + info->
iconHug;
904 container->children[container->nbChildren] = (
nbgl_obj_t *) image;
905 container->nbChildren++;
916 container->children[container->nbChildren] = (
nbgl_obj_t *) anim;
917 container->nbChildren++;
928 tickerCfg.tickerCallback = &animTickerCallback;
933 if (info->
title != NULL) {
936 textArea->text = PIC(info->
title);
937 textArea->textAlignment =
CENTER;
938 textArea->fontId = LARGE_MEDIUM_FONT;
939 textArea->wrapping =
true;
942 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
945 if (container->nbChildren > 0) {
948 textArea->obj.alignmentMarginY = ICON_TITLE_MARGIN + info->
iconHug;
954 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY;
956 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
957 container->nbChildren++;
964 textArea->textAlignment =
CENTER;
965 textArea->fontId = SMALL_BOLD_FONT;
966 textArea->wrapping =
true;
969 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
972 if (container->nbChildren > 0) {
974 textArea->obj.alignTo = (
nbgl_obj_t *) container->children[container->nbChildren - 1];
975 textArea->obj.alignmentMarginY = VERTICAL_BORDER_MARGIN;
976 if (container->children[container->nbChildren - 1]->type ==
IMAGE) {
977 textArea->obj.alignmentMarginY = VERTICAL_BORDER_MARGIN + info->
iconHug;
980 textArea->obj.alignmentMarginY = 16;
987 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY;
989 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
990 container->nbChildren++;
997 textArea->textAlignment =
CENTER;
998 textArea->fontId = SMALL_REGULAR_FONT;
999 textArea->wrapping =
true;
1002 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1005 if (container->nbChildren > 0) {
1007 textArea->obj.alignTo = (
nbgl_obj_t *) container->children[container->nbChildren - 1];
1008 if (container->children[container->nbChildren - 1]->type ==
TEXT_AREA) {
1010 textArea->obj.alignmentMarginY = TITLE_DESC_MARGIN;
1013 textArea->obj.alignmentMarginY = VERTICAL_BORDER_MARGIN + info->
iconHug;
1020 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY;
1022 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
1023 container->nbChildren++;
1029 textArea->text = PIC(info->
subText);
1030 textArea->textAlignment =
CENTER;
1031 textArea->fontId = SMALL_REGULAR_FONT;
1032 textArea->wrapping =
true;
1035 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1037 textArea->obj.area.height += 2 * 8;
1039 if (container->nbChildren > 0) {
1041 textArea->obj.alignTo = (
nbgl_obj_t *) container->children[container->nbChildren - 1];
1042 textArea->obj.alignmentMarginY = 16;
1043 if (container->children[container->nbChildren - 1]->type ==
IMAGE) {
1044 textArea->obj.alignmentMarginY += info->
iconHug;
1051 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY;
1053 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
1054 container->nbChildren++;
1057 container->obj.alignment =
CENTER;
1059 container->obj.area.height = fullHeight;
1061 container->obj.area.height += 40;
1085 if (description->
modal) {
1086 if (gLayout[1].nbChildren == 0) {
1087 layout = &gLayout[1];
1089 else if (gLayout[2].nbChildren == 0) {
1090 layout = &gLayout[2];
1096 layout = &gLayout[0];
1098 if (layout == NULL) {
1106 nbTouchableControls = 0;
1111 if (description->
modal) {
1125 layout->
container->obj.area.width = SCREEN_WIDTH;
1126 layout->
container->obj.area.height = SCREEN_HEIGHT;
1170 uint16_t swipesMask,
1173 tune_index_e tuneId)
1178 if (layout == NULL) {
1185 layoutInt->
tapText->text = PIC(text);
1187 layoutInt->
tapText->fontId = SMALL_REGULAR_FONT;
1191 layoutInt->
tapText->obj.alignmentMarginY = TAP_TO_CONTINUE_MARGIN;
1209 if (layout == NULL) {
1239 tune_index_e tuneId)
1246 if (layout == NULL) {
1257 button->radius = BUTTON_RADIUS;
1258 button->obj.alignmentMarginX = BORDER_MARGIN;
1259 button->obj.alignmentMarginY = BORDER_MARGIN;
1260 button->foregroundColor =
BLACK;
1261 button->innerColor =
WHITE;
1263 button->obj.touchMask = (1 <<
TOUCHED);
1265 button->icon = PIC(icon);
1310 bool separationLine,
1311 tune_index_e tuneId)
1340 if (layout == NULL) {
1344 if (barLayout->
text == NULL) {
1357 container = addListItem(layoutInt, &itemDesc);
1359 if (container == NULL) {
1362 return container->obj.area.height;
1379 if (layout == NULL) {
1383 if (switchLayout->
text == NULL) {
1387 itemDesc.
text = switchLayout->
text;
1392 itemDesc.
large =
false;
1394 container = addListItem(layoutInt, &itemDesc);
1396 if (container == NULL) {
1399 return container->obj.area.height;
1417 if (layout == NULL) {
1421 itemDesc.
text = text;
1426 container = addListItem(layoutInt, &itemDesc);
1428 if (container == NULL) {
1431 return container->obj.area.height;
1447 const char *subText,
1455 if (layout == NULL) {
1459 itemDesc.
text = text;
1462 itemDesc.
token = token;
1465 itemDesc.
index = index;
1467 container = addListItem(layoutInt, &itemDesc);
1469 if (container == NULL) {
1472 return container->obj.area.height;
1489 if (layout == NULL) {
1495 textArea->text = PIC(text);
1496 textArea->textAlignment =
MID_LEFT;
1497 textArea->fontId = LARGE_MEDIUM_FONT;
1499 textArea->wrapping =
true;
1501 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1504 textArea->obj.alignmentMarginX = BORDER_MARGIN;
1505 if (layoutInt->
container->nbChildren == 0) {
1507 textArea->obj.alignmentMarginY += PRE_FIRST_TEXT_MARGIN;
1510 textArea->obj.alignmentMarginY = INTER_PARAGRAPHS_MARGIN;
1533 const char *description,
1540 if (layout == NULL) {
1546 textArea->textColor =
BLACK;
1547 textArea->text = PIC(title);
1548 textArea->textAlignment =
MID_LEFT;
1549 textArea->fontId = LARGE_MEDIUM_FONT;
1551 textArea->wrapping =
true;
1553 textArea->obj.alignmentMarginX = BORDER_MARGIN;
1554 textArea->obj.alignmentMarginY = PRE_TITLE_MARGIN;
1557 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1563 textArea->textColor =
BLACK;
1564 textArea->text = PIC(description);
1565 textArea->fontId = SMALL_REGULAR_FONT;
1567 textArea->wrapping =
true;
1570 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1571 textArea->textAlignment =
MID_LEFT;
1573 textArea->obj.alignmentMarginX = BORDER_MARGIN;
1574 textArea->obj.alignmentMarginY = PRE_DESCRIPTION_MARGIN;
1581 textArea->text = PIC(info);
1582 textArea->fontId = SMALL_REGULAR_FONT;
1584 textArea->wrapping =
true;
1587 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1588 textArea->textAlignment =
MID_LEFT;
1590 textArea->obj.alignmentMarginX = BORDER_MARGIN;
1591 textArea->obj.alignmentMarginY = 40;
1595 return layoutInt->
container->obj.area.height;
1612 if (layout == NULL) {
1615 for (i = 0; i < choices->
nbChoices; i++) {
1632 container->nbChildren = 2;
1635 container->obj.area.height = RADIO_CHOICE_HEIGHT;
1637 container->obj.alignmentMarginX = BORDER_MARGIN;
1638 container->obj.alignTo = (
nbgl_obj_t *) NULL;
1641 button->activeColor =
BLACK;
1643 button->obj.alignTo = (
nbgl_obj_t *) container;
1646 container->children[1] = (
nbgl_obj_t *) button;
1650#ifdef HAVE_LANGUAGE_PACK
1651 textArea->text = get_ux_loc_string(choices->nameIds[i]);
1655 textArea->text = PIC(choices->
names[i]);
1657 textArea->textAlignment =
MID_LEFT;
1658 textArea->obj.area.width = container->obj.area.width - RADIO_WIDTH;
1660 textArea->obj.alignment =
MID_LEFT;
1661 textArea->obj.alignTo = (
nbgl_obj_t *) container;
1662 container->children[0] = (
nbgl_obj_t *) textArea;
1665 container->obj.touchMask = (1 <<
TOUCHED);
1666 container->obj.touchId =
CONTROLS_ID + nbTouchableControls;
1667 nbTouchableControls++;
1672 textArea->textColor =
BLACK;
1673 textArea->fontId = SMALL_BOLD_FONT;
1678 textArea->fontId = SMALL_REGULAR_FONT;
1682 line = createHorizontalLine(layoutInt->
layer);
1683 line->obj.alignmentMarginY = -1;
1708 if (layout == NULL) {
1715 if (info->
text1 != NULL) {
1723 if (info->
text2 != NULL) {
1731 if (info->
text3 != NULL) {
1739 container = addContentCenter(layoutInt, ¢eredInfo);
1742 container->obj.alignmentMarginX = BORDER_MARGIN;
1743 container->obj.alignmentMarginY = BORDER_MARGIN + info->
offsetY;
1747 container->obj.alignmentMarginY = info->
offsetY;
1750 return container->obj.area.height;
1767 if (layout == NULL) {
1771 container = addContentCenter(layoutInt, info);
1773 return container->obj.area.height;
1791 if (layout == NULL) {
1797 container->nbChildren = info->
nbRows + 1;
1801 container->obj.alignmentMarginX = BORDER_MARGIN;
1805 textArea->textColor =
BLACK;
1806 textArea->text = PIC(info->
title);
1807 textArea->textAlignment =
MID_LEFT;
1808 textArea->fontId = LARGE_MEDIUM_FONT;
1809 textArea->wrapping =
true;
1811 textArea->obj.alignmentMarginY = 24;
1815 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1817 container->obj.area.height += textArea->obj.area.height;
1819 container->children[0] = (
nbgl_obj_t *) textArea;
1821 for (row = 0; row < info->
nbRows; row++) {
1827 rowContainer->nbChildren = 2;
1832 image->foregroundColor =
BLACK;
1833 image->buffer = info->
rowIcons[row];
1834 rowContainer->children[0] = (
nbgl_obj_t *) image;
1837 textArea->textColor =
BLACK;
1838 textArea->text = info->
rowTexts[row];
1839 textArea->textAlignment =
MID_LEFT;
1840 textArea->fontId = SMALL_REGULAR_FONT;
1841 textArea->wrapping =
true;
1842 textArea->obj.area.width
1845 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1847 rowContainer->children[1] = (
nbgl_obj_t *) textArea;
1848 rowContainer->obj.area.height
1849 =
MAX(image->buffer->height, textArea->obj.area.height + LEFT_CONTENT_TEXT_PADDING);
1852 rowContainer->obj.alignmentMarginY = PRE_FIRST_ROW_MARGIN;
1855 rowContainer->obj.alignmentMarginY = INTER_ROWS_MARGIN;
1857 container->children[1 + row] = (
nbgl_obj_t *) rowContainer;
1858 container->obj.area.height
1859 += rowContainer->obj.area.height + rowContainer->obj.alignmentMarginY;
1863 return container->obj.area.height;
1881 uint16_t fullHeight = 0;
1884 if (layout == NULL) {
1892 container->nbChildren = 0;
1896 if (strlen(PIC(info->
url)) > 62) {
1919 fullHeight +=
qrcode->obj.area.height;
1921 container->nbChildren++;
1923 if (info->
text1 != NULL) {
1925 textArea->textColor =
BLACK;
1926 textArea->text = PIC(info->
text1);
1927 textArea->textAlignment =
CENTER;
1928 textArea->fontId = (info->
largeText1 ==
true) ? LARGE_MEDIUM_FONT : SMALL_REGULAR_FONT;
1929 textArea->wrapping =
true;
1932 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1934 textArea->obj.alignTo = (
nbgl_obj_t *) container->children[container->nbChildren - 1];
1935 textArea->obj.alignmentMarginY = QR_PRE_TEXT_MARGIN;
1937 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY;
1939 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
1940 container->nbChildren++;
1942 if (info->
text2 != NULL) {
1945 textArea->text = PIC(info->
text2);
1946 textArea->textAlignment =
CENTER;
1947 textArea->fontId = SMALL_REGULAR_FONT;
1948 textArea->wrapping =
true;
1951 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1953 textArea->obj.alignTo = (
nbgl_obj_t *) container->children[container->nbChildren - 1];
1954 if (info->
text1 != NULL) {
1955 textArea->obj.alignmentMarginY = QR_INTER_TEXTS_MARGIN;
1958 textArea->obj.alignmentMarginY = 32;
1961 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY + 8;
1963 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
1964 container->nbChildren++;
1967 if ((fullHeight >= (layoutInt->
container->obj.area.height - 16))
1975 container->obj.area.height = fullHeight;
1978 container->obj.alignment =
CENTER;
1982 container->obj.alignTo
1985 container->obj.alignmentMarginY = info->
offsetY;
2031 .horizontalButtons.leftIcon = info->
leftIcon,
2032 .horizontalButtons.leftToken = info->
leftToken,
2033 .horizontalButtons.rightText = info->
rightText,
2034 .horizontalButtons.rightToken = info->
rightToken,
2035 .horizontalButtons.tuneId = info->
tuneId};
2057 if (layout == NULL) {
2061 for (i = 0; i < list->
nbPairs; i++) {
2063 uint16_t fullHeight = 0;
2066 if (list->
pairs != NULL) {
2067 pair = &list->
pairs[i];
2084 itemTextArea->text = PIC(pair->
item);
2085 itemTextArea->textAlignment =
MID_LEFT;
2086 itemTextArea->fontId = SMALL_REGULAR_FONT;
2087 itemTextArea->wrapping =
true;
2090 itemTextArea->fontId, itemTextArea->text,
AVAILABLE_WIDTH, itemTextArea->wrapping);
2093 itemTextArea->obj.alignmentMarginX = 0;
2094 itemTextArea->obj.alignmentMarginY = 0;
2095 itemTextArea->obj.alignTo = NULL;
2096 container->children[container->nbChildren] = (
nbgl_obj_t *) itemTextArea;
2097 container->nbChildren++;
2099 fullHeight += itemTextArea->obj.area.height;
2102 valueTextArea->textColor =
BLACK;
2103 valueTextArea->text = PIC(pair->
value);
2104 valueTextArea->textAlignment =
MID_LEFT;
2106 valueTextArea->fontId = SMALL_BOLD_FONT;
2109 valueTextArea->fontId = LARGE_MEDIUM_FONT;
2117 valueIcon = &MINI_PUSH_ICON;
2124 valueTextArea->obj.area.width =
AVAILABLE_WIDTH - valueIcon->width - 12;
2130 valueTextArea->text,
2131 valueTextArea->obj.area.width,
2139 valueTextArea->obj.area.height = nbLines * font->
line_height;
2142 valueTextArea->obj.alignmentMarginY = 4;
2143 valueTextArea->obj.alignTo = (
nbgl_obj_t *) itemTextArea;
2144 valueTextArea->wrapping = list->
wrapping;
2145 container->children[container->nbChildren] = (
nbgl_obj_t *) valueTextArea;
2146 container->nbChildren++;
2148 fullHeight += valueTextArea->obj.area.height + valueTextArea->obj.alignmentMarginY;
2149 if (valueIcon != NULL) {
2155 image->foregroundColor =
BLACK;
2156 image->buffer = valueIcon;
2158 image->obj.alignmentMarginX = 12;
2159 image->obj.alignTo = (
nbgl_obj_t *) valueTextArea;
2161 container->obj.touchMask = (1 <<
TOUCHED);
2164 container->children[container->nbChildren] = (
nbgl_obj_t *) image;
2165 container->nbChildren++;
2169 container->obj.area.height = fullHeight;
2171 container->obj.alignmentMarginX = BORDER_MARGIN;
2173 container->obj.alignmentMarginY = INTER_TAG_VALUE_MARGIN;
2176 container->obj.alignmentMarginY = PRE_TAG_VALUE_MARGIN;
2200 const char *subText,
2209 if (layout == NULL) {
2216 container->nbChildren = (subText != NULL) ? 3 : 2;
2221 container->obj.alignment =
CENTER;
2225 progress->foregroundColor =
BLACK;
2226 progress->withBorder =
true;
2227 progress->state = percentage;
2228 progress->obj.area.width = PROGRESSBAR_WIDTH;
2229 progress->obj.area.height = PROGRESSBAR_HEIGHT;
2233 container->children[0] = (
nbgl_obj_t *) progress;
2236 container->obj.area.height = progress->obj.alignmentMarginY + progress->obj.area.height;
2240 textArea->textColor =
BLACK;
2241 textArea->text = PIC(text);
2242 textArea->textAlignment =
CENTER;
2243 textArea->fontId = LARGE_MEDIUM_FONT;
2244 textArea->wrapping =
true;
2245 textArea->obj.alignmentMarginY = BAR_TEXT_MARGIN;
2246 textArea->obj.alignTo = (
nbgl_obj_t *) progress;
2250 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
2254 container->obj.area.height += textArea->obj.alignmentMarginY + textArea->obj.area.height;
2257 container->children[1] = (
nbgl_obj_t *) textArea;
2259 if (subText != NULL) {
2263 subTextArea->textColor =
BLACK;
2264 subTextArea->text = PIC(subText);
2265 subTextArea->textAlignment =
CENTER;
2266 subTextArea->fontId = SMALL_REGULAR_FONT;
2267 subTextArea->wrapping =
true;
2268 subTextArea->obj.alignmentMarginY = BAR_INTER_TEXTS_MARGIN;
2269 subTextArea->obj.alignTo = (
nbgl_obj_t *) textArea;
2274 subTextArea->obj.area.width,
2275 subTextArea->wrapping);
2279 container->obj.area.height
2280 += subTextArea->obj.alignmentMarginY + subTextArea->obj.area.height;
2283 container->children[2] = (
nbgl_obj_t *) subTextArea;
2286 container->obj.area.height = (container->obj.area.height + 7) & 0xFFF8;
2305 line = createHorizontalLine(layoutInt->
layer);
2306 line->obj.alignmentMarginY = -1;
2325 if (layout == NULL) {
2361 button->obj.alignmentMarginX = BORDER_MARGIN;
2362 button->obj.alignmentMarginY = 12;
2365 button->innerColor =
BLACK;
2366 button->foregroundColor =
WHITE;
2369 button->innerColor =
WHITE;
2370 button->foregroundColor =
BLACK;
2373 button->borderColor =
WHITE;
2377 button->borderColor =
BLACK;
2383 button->text = PIC(buttonInfo->
text);
2384 button->fontId = SMALL_BOLD_FONT;
2385 button->icon = PIC(buttonInfo->
icon);
2388 + SMALL_BUTTON_HEIGHT
2389 + ((button->icon) ? (button->icon->width + 12) : 0);
2390 button->obj.area.height = SMALL_BUTTON_HEIGHT;
2391 button->radius = SMALL_BUTTON_RADIUS_INDEX;
2392 if (buttonInfo->
onBottom !=
true) {
2393 button->obj.alignmentMarginX += (
AVAILABLE_WIDTH - button->obj.area.width) / 2;
2399 button->radius = BUTTON_RADIUS;
2401 button->obj.alignTo = NULL;
2402 button->obj.touchMask = (1 <<
TOUCHED);
2422 tune_index_e tuneId)
2425 .longPress.text = text,
2426 .longPress.token = token,
2427 .longPress.tuneId = tuneId};
2430 if (layout == NULL) {
2450 tune_index_e tuneId)
2475 const char *leftText,
2477 const char *rightText,
2479 tune_index_e tuneId)
2510 if (layout == NULL) {
2524 switch (headerDesc->
type) {
2555 button->innerColor =
WHITE;
2557 button->borderColor =
WHITE;
2558 button->obj.area.width = BACK_KEY_WIDTH;
2559 button->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2560 button->text = NULL;
2561 button->icon = PIC(&LEFT_ARROW_ICON);
2574 image->foregroundColor =
BLACK;
2575 image->obj.alignment =
CENTER;
2590 textArea->obj.touchMask = (1 <<
TOUCHED);
2592 textArea->obj.alignment =
CENTER;
2593 textArea->textColor =
BLACK;
2594 textArea->obj.area.width
2598 textArea->obj.area.width -= 16 + image->buffer->width;
2600 textArea->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2601 textArea->text = text;
2602 textArea->fontId = SMALL_BOLD_FONT;
2603 textArea->textAlignment =
CENTER;
2604 textArea->wrapping =
true;
2609 textArea->obj.area.width,
2613 "nbgl_layoutAddHeader: text [%s] is too long for header\n",
2624 textArea->obj.alignmentMarginX = 8 + image->buffer->width / 2;
2625 image->obj.alignmentMarginX = -8 - textArea->obj.area.width / 2;
2641 actionButton->obj.touchMask = (1 <<
TOUCHED);
2644 actionButton->obj.alignment =
MID_RIGHT;
2645 actionButton->innerColor =
WHITE;
2646 button->foregroundColor
2649 actionButton->borderColor =
WHITE;
2650 actionButton->obj.area.width = BACK_KEY_WIDTH;
2651 actionButton->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2652 actionButton->text = NULL;
2660 layoutInt->
headerContainer->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2666 line = createHorizontalLine(layoutInt->
layer);
2668 line->obj.alignmentMarginY = TOUCHABLE_HEADER_BAR_HEIGHT;
2674 subTextArea->textColor =
BLACK;
2676 subTextArea->textAlignment =
MID_LEFT;
2677 subTextArea->fontId = SMALL_REGULAR_FONT;
2678 subTextArea->wrapping =
true;
2680 subTextArea->obj.alignmentMarginY = SUB_HEADER_MARGIN;
2682 subTextArea->obj.area.height
2685 subTextArea->obj.area.width,
2686 subTextArea->wrapping);
2691 += subTextArea->obj.area.height + 2 * SUB_HEADER_MARGIN;
2693 if (button != NULL) {
2694 button->obj.alignmentMarginY
2695 -= (subTextArea->obj.area.height + 2 * SUB_HEADER_MARGIN) / 2;
2697 if (textArea != NULL) {
2698 textArea->obj.alignmentMarginY
2699 -= (subTextArea->obj.area.height + 2 * SUB_HEADER_MARGIN) / 2;
2701 if (actionButton != NULL) {
2702 actionButton->obj.alignmentMarginY
2703 -= (subTextArea->obj.area.height + 2 * SUB_HEADER_MARGIN) / 2;
2722 button->innerColor =
WHITE;
2723 button->foregroundColor =
BLACK;
2724 button->borderColor =
WHITE;
2725 button->obj.area.width = BACK_KEY_WIDTH;
2726 button->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2727 button->text = NULL;
2728 button->icon = PIC(&LEFT_ARROW_ICON);
2729 button->obj.touchMask = (1 <<
TOUCHED);
2746 progress->obj.area.width = 224;
2747 progress->obj.alignment =
CENTER;
2755 layoutInt->
headerContainer->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2761 textArea->textColor =
BLACK;
2763 textArea->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2764 textArea->text = PIC(headerDesc->
title.
text);
2765 textArea->fontId = SMALL_BOLD_FONT;
2766 textArea->textAlignment =
CENTER;
2767 textArea->wrapping =
true;
2771 layoutInt->
headerContainer->obj.area.height = textArea->obj.area.height;
2784 textArea->obj.alignmentMarginX = BORDER_MARGIN;
2785 textArea->textColor =
BLACK;
2787 textArea->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2789 textArea->fontId = SMALL_BOLD_FONT;
2791 textArea->obj.touchMask = (1 <<
TOUCHED);
2797 layoutInt->
headerContainer->obj.area.height = textArea->obj.area.height;
2805 line = createHorizontalLine(layoutInt->
layer);
2841 if (layout == NULL) {
2855 switch (footerDesc->
type) {
2873 textArea->obj.area.height
2878 textArea->textAlignment =
CENTER;
2879 textArea->obj.touchMask = (1 <<
TOUCHED);
2884 layoutInt->
footerContainer->obj.area.height = textArea->obj.area.height;
2897 textArea->textColor =
BLACK;
2899 textArea->obj.area.height = SIMPLE_FOOTER_HEIGHT;
2901 textArea->fontId = SMALL_BOLD_FONT;
2902 textArea->textAlignment =
CENTER;
2903 textArea->obj.touchMask = (1 <<
TOUCHED);
2921 textArea->textColor =
BLACK;
2923 textArea->obj.area.height = SIMPLE_FOOTER_HEIGHT;
2925 textArea->fontId = SMALL_BOLD_FONT;
2926 textArea->textAlignment =
CENTER;
2927 textArea->obj.touchMask = (1 <<
TOUCHED);
2933 layoutInt->
footerContainer->obj.area.height = textArea->obj.area.height;
2938 separationLine->obj.area.width = 1;
2939 separationLine->obj.area.height = layoutInt->
footerContainer->obj.area.height;
2940 separationLine->direction =
VERTICAL;
2941 separationLine->thickness = 1;
2942 separationLine->obj.alignment =
MID_LEFT;
2943 separationLine->obj.alignTo = (
nbgl_obj_t *) textArea;
2944 separationLine->obj.alignmentMarginX = -1;
2960 textArea->textColor =
BLACK;
2961 textArea->obj.area.width = FOOTER_TEXT_AND_NAV_WIDTH;
2962 textArea->obj.area.height = SIMPLE_FOOTER_HEIGHT;
2964 textArea->fontId = SMALL_BOLD_FONT;
2965 textArea->textAlignment =
CENTER;
2966 textArea->obj.touchMask = (1 <<
TOUCHED);
2978 navContainer->nbChildren = 4;
2979 navContainer->children
2982 navContainer->obj.area.width = SCREEN_WIDTH - textArea->obj.area.width;
2983 navContainer->obj.area.height = SIMPLE_FOOTER_HEIGHT;
2996 separationLine->obj.area.width = 1;
2997 separationLine->obj.area.height = layoutInt->
footerContainer->obj.area.height;
2998 separationLine->direction =
VERTICAL;
2999 separationLine->thickness = 1;
3000 separationLine->obj.alignment =
MID_LEFT;
3001 separationLine->obj.alignTo = (
nbgl_obj_t *) navContainer;
3002 separationLine->obj.alignmentMarginX = -1;
3041 button->obj.alignmentMarginY = SINGLE_BUTTON_MARGIN;
3043 button->innerColor =
BLACK;
3044 button->foregroundColor =
WHITE;
3047 button->innerColor =
WHITE;
3048 button->foregroundColor =
BLACK;
3052 button->borderColor =
WHITE;
3056 button->borderColor =
BLACK;
3063 button->fontId = SMALL_BOLD_FONT;
3065 button->radius = BUTTON_RADIUS;
3074 button->obj.touchMask = (1 <<
TOUCHED);
3102 button->innerColor =
WHITE;
3105 button->obj.alignmentMarginY
3106 = VERTICAL_BORDER_MARGIN;
3110 button->obj.alignmentMarginY
3111 = BUTTON_FROM_BOTTOM_MARGIN;
3112 button->borderColor =
WHITE;
3114 button->foregroundColor =
BLACK;
3116 button->obj.area.height = FOOTER_IN_PAIR_HEIGHT;
3117 button->radius = BUTTON_RADIUS;
3119 button->fontId = SMALL_BOLD_FONT;
3120 button->obj.touchMask = (1 <<
TOUCHED);
3130 line = createHorizontalLine(layoutInt->
layer);
3152 button->obj.alignmentMarginY
3153 = TOP_BUTTON_MARGIN_WITH_ACTION;
3156 button->obj.alignmentMarginY = TOP_BUTTON_MARGIN;
3159 button->innerColor =
WHITE;
3161 button->foregroundColor =
BLACK;
3164 button->innerColor =
BLACK;
3165 button->borderColor =
BLACK;
3166 button->foregroundColor =
WHITE;
3170 button->radius = BUTTON_RADIUS;
3175 button->fontId = SMALL_BOLD_FONT;
3176 button->obj.touchMask = (1 <<
TOUCHED);
3184 layoutInt->
footerContainer->obj.area.height = ACTION_AND_FOOTER_FOOTER_HEIGHT;
3187 layoutInt->
footerContainer->obj.area.height = ROUNDED_AND_FOOTER_FOOTER_HEIGHT;
3198 addSwipeInternal(layoutInt,
3209 line = createHorizontalLine(layoutInt->
layer);
3215 if (separationLine != NULL) {
3248 if (layout == NULL) {
3265 switch (upFooterDesc->
type) {
3284 button->obj.alignmentMarginX = BORDER_MARGIN;
3286 button->innerColor =
BLACK;
3287 button->foregroundColor =
WHITE;
3288 button->borderColor =
BLACK;
3291 button->radius = BUTTON_RADIUS;
3292 button->icon = PIC(&VALIDATE_ICON);
3296 textArea->textColor =
BLACK;
3298 textArea->textAlignment =
MID_LEFT;
3299 textArea->fontId = LARGE_MEDIUM_FONT;
3300 textArea->wrapping =
true;
3301 textArea->obj.area.width = SCREEN_WIDTH - 3 * BORDER_MARGIN - button->obj.area.width;
3303 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
3305 textArea->obj.alignment =
MID_LEFT;
3306 textArea->obj.alignmentMarginX = BORDER_MARGIN;
3309 line = createHorizontalLine(layoutInt->
layer);
3311 line->obj.alignmentMarginY = VERTICAL_ALIGNMENT - 1;
3315 progressBar->obj.area.width = SCREEN_WIDTH;
3316 progressBar->obj.area.height = LONG_PRESS_PROGRESS_HEIGHT;
3318 progressBar->obj.alignmentMarginY = LONG_PRESS_PROGRESS_ALIGN;
3319 progressBar->resetIfOverriden =
true;
3320 progressBar->partialRedraw =
true;
3336 button->obj.alignment =
CENTER;
3339 button->innerColor =
BLACK;
3340 button->foregroundColor =
WHITE;
3343 button->innerColor =
WHITE;
3344 button->foregroundColor =
BLACK;
3347 button->borderColor =
WHITE;
3351 button->borderColor =
BLACK;
3357 button->text = PIC(upFooterDesc->
button.
text);
3358 button->fontId = SMALL_BOLD_FONT;
3359 button->icon = PIC(upFooterDesc->
button.
icon);
3362 button->radius = BUTTON_RADIUS;
3364 button->obj.alignTo = NULL;
3365 button->obj.touchMask = (1 <<
TOUCHED);
3392 button->obj.alignmentMarginX = BORDER_MARGIN;
3394 button->innerColor =
WHITE;
3395 button->foregroundColor =
BLACK;
3398 button->radius = BUTTON_RADIUS;
3400 button->fontId = SMALL_BOLD_FONT;
3401 button->obj.touchMask = (1 <<
TOUCHED);
3417 button->obj.alignmentMarginX = BORDER_MARGIN;
3418 button->innerColor =
BLACK;
3419 button->borderColor =
BLACK;
3420 button->foregroundColor =
WHITE;
3423 button->radius = BUTTON_RADIUS;
3425 button->fontId = SMALL_BOLD_FONT;
3426 button->obj.touchMask = (1 <<
TOUCHED);
3448 textArea->textColor =
BLACK;
3449 textArea->text = PIC(upFooterDesc->
tipBox.
text);
3450 textArea->textAlignment =
MID_LEFT;
3451 textArea->fontId = SMALL_REGULAR_FONT;
3452 textArea->wrapping =
true;
3455 textArea->obj.area.width
3460 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
3461 textArea->obj.alignment =
MID_LEFT;
3462 textArea->obj.alignmentMarginX = BORDER_MARGIN;
3466 line = createHorizontalLine(layoutInt->
layer);
3472 image->obj.alignmentMarginX = BORDER_MARGIN;
3474 image->foregroundColor =
BLACK;
3475 image->buffer = PIC(upFooterDesc->
tipBox.
icon);
3488 upFooterDesc->
text.token,
3489 upFooterDesc->
text.tuneId);
3499 if (strlen(PIC(upFooterDesc->
text.text))) {
3502 textArea->text = PIC(upFooterDesc->
text.text);
3503 textArea->textAlignment =
CENTER;
3504 textArea->fontId = SMALL_REGULAR_FONT;
3505 textArea->wrapping =
true;
3508 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
3509 textArea->obj.alignment =
CENTER;
3546 tune_index_e tuneId)
3549 .separationLine =
false,
3550 .progressAndBack.activePage = activePage,
3551 .progressAndBack.nbPages = nbPages,
3552 .progressAndBack.token = backToken,
3553 .progressAndBack.tuneId = tuneId,
3554 .progressAndBack.withBack = withBack,
3555 .progressAndBack.actionIcon = NULL,
3574 const char *subText,
3575 uint8_t initPosition)
3583 if (layout == NULL) {
3589 container->nbChildren = 3;
3594 container->obj.alignment =
CENTER;
3598 spinner->position = initPosition;
3601 container->children[0] = (
nbgl_obj_t *) spinner;
3604 container->obj.area.height += SPINNER_HEIGHT;
3608 textArea->textColor =
BLACK;
3609 textArea->text = PIC(text);
3610 textArea->textAlignment =
CENTER;
3611 textArea->fontId = (subText != NULL) ? LARGE_MEDIUM_FONT : SMALL_REGULAR_FONT;
3612 textArea->wrapping =
true;
3613 textArea->obj.alignmentMarginY = SPINNER_TEXT_MARGIN;
3614 textArea->obj.alignTo = (
nbgl_obj_t *) spinner;
3618 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
3622 container->obj.area.height += textArea->obj.alignmentMarginY + textArea->obj.area.height;
3625 container->children[1] = (
nbgl_obj_t *) textArea;
3627 if (subText != NULL) {
3631 subTextArea->textColor =
BLACK;
3632 subTextArea->text = PIC(subText);
3633 subTextArea->textAlignment =
CENTER;
3634 subTextArea->fontId = SMALL_REGULAR_FONT;
3635 subTextArea->wrapping =
true;
3636 subTextArea->obj.alignmentMarginY = SPINNER_INTER_TEXTS_MARGIN;
3637 subTextArea->obj.alignTo = (
nbgl_obj_t *) textArea;
3642 subTextArea->obj.area.width,
3643 subTextArea->wrapping);
3647 container->obj.area.height
3648 += subTextArea->obj.alignmentMarginY + subTextArea->obj.area.height;
3651 container->children[2] = (
nbgl_obj_t *) subTextArea;
3661 tickerCfg.tickerCallback = &spinnerTickerCallback;
3681 const char *subText,
3691 if ((layout == NULL) || (layoutInt->
container->nbChildren == 0)) {
3696 if ((container->obj.type !=
CONTAINER) || (container->nbChildren < 2)) {
3701 if (spinner->obj.type !=
SPINNER) {
3705 if (spinner->position != position) {
3706 spinner->position = position;
3716 const char *newText = PIC(text);
3717 size_t newTextLen = strlen(newText);
3719 if ((newTextLen != strlen(textArea->text)) || memcmp(textArea->text, newText, newTextLen)) {
3720 textArea->text = newText;
3725 if (subText != NULL) {
3728 if (container->nbChildren != 3) {
3732 if (subTextArea->obj.type !=
TEXT_AREA) {
3735 const char *newSubText = PIC(subText);
3736 size_t newSubTextLen = strlen(newSubText);
3738 if ((newSubTextLen != strlen(subTextArea->text))
3739 || memcmp(subTextArea->text, newSubText, newSubTextLen)) {
3740 subTextArea->text = newSubText;
3759 if (layout == NULL) {
3763 "nbgl_layoutDraw(): container.nbChildren =%d, layout->nbChildren = %d\n",
3792 if (layout == NULL) {
3796 if (layout->
modal) {
Random Number Generation.
@ ANIM_ILLUSTRATION
animation
@ ICON_ILLUSTRATION
simple icon
#define LOG_WARN(__logger,...)
#define LOG_DEBUG(__logger,...)
#define LOG_FATAL(__logger,...)
Middle Level API of the new BOLOS Graphical Library.
#define QR_V10_NB_PIX_SIZE
#define QR_V4_NB_PIX_SIZE
uint8_t nbgl_getFontHeight(nbgl_font_id_e fontId)
return the height in pixels of the font with the given font ID
uint16_t nbgl_getTextWidth(nbgl_font_id_e fontId, const char *text)
return the max width in pixels of the given text (can be multiline)
uint16_t nbgl_getTextHeightInWidth(nbgl_font_id_e fontId, const char *text, uint16_t maxWidth, bool wrapping)
return the height of the given multiline text, with the given font.
uint16_t nbgl_getTextNbLinesInWidth(nbgl_font_id_e fontId, const char *text, uint16_t maxWidth, bool wrapping)
compute the number of lines of the given text fitting in the given maxWidth
const nbgl_font_t * nbgl_getFont(nbgl_font_id_e fontId)
uint8_t nbgl_getFontLineHeight(nbgl_font_id_e fontId)
return the height in pixels of the line of font with the given font ID
Font screen low-Level driver API, to draw elementary forms.
int nbgl_layoutAddTagValueList(nbgl_layout_t *layout, const nbgl_layoutTagValueList_t *list)
Creates a list of [tag,value] pairs.
int nbgl_layoutAddContentCenter(nbgl_layout_t *layout, const nbgl_contentCenter_t *info)
Creates an area on the center of the main panel, with a possible icon, and possible texts under it.
#define HOLD_TO_APPROVE_STEP_PERCENT
int nbgl_layoutAddUpFooter(nbgl_layout_t *layout, const nbgl_layoutUpFooter_t *upFooterDesc)
Creates a touchable area on top of the footer of the screen, containing various controls,...
int nbgl_layoutDraw(nbgl_layout_t *layoutParam)
Applies given layout. The screen will be redrawn.
#define NB_MAX_CONTAINER_CHILDREN
int nbgl_layoutAddTextContent(nbgl_layout_t *layout, const char *title, const char *description, const char *info)
Creates in the main container three text areas:
int nbgl_layoutAddText(nbgl_layout_t *layout, const char *text, const char *subText)
Creates an area with given text (in bold) and sub text (in regular)
int nbgl_layoutAddProgressIndicator(nbgl_layout_t *layout, uint8_t activePage, uint8_t nbPages, bool withBack, uint8_t backToken, tune_index_e tuneId)
Creates a kind of navigation bar with an optional <- arrow on the left. This widget is placed on top ...
int nbgl_layoutAddNavigationBar(nbgl_layout_t *layout, const nbgl_layoutNavigationBar_t *info)
Creates a navigation bar on bottom of main container.
int nbgl_layoutAddSeparationLine(nbgl_layout_t *layout)
adds a separation line on bottom of the last added item
int nbgl_layoutAddQRCode(nbgl_layout_t *layout, const nbgl_layoutQRCode_t *info)
Creates an area on the center of the main panel, with a QRCode, a possible text in black (bold) under...
int nbgl_layoutAddRadioChoice(nbgl_layout_t *layout, const nbgl_layoutRadioChoice_t *choices)
Creates a list of radio buttons (on the right)
int nbgl_layoutAddCenteredInfo(nbgl_layout_t *layout, const nbgl_layoutCenteredInfo_t *info)
Creates an area on the center of the main panel, with a possible icon/image, a possible text in black...
int nbgl_layoutAddSplitFooter(nbgl_layout_t *layout, const char *leftText, uint8_t leftToken, const char *rightText, uint8_t rightToken, tune_index_e tuneId)
Creates 2 touchable texts at the footer of the screen, separated with a thin line from the rest of th...
int nbgl_layoutAddTextWithAlias(nbgl_layout_t *layout, const char *text, const char *subText, uint8_t token, uint8_t index)
Creates an area with given text (in bold) and sub text (in regular), with a icon on right of text to...
int nbgl_layoutAddTouchableBar(nbgl_layout_t *layout, const nbgl_layoutBar_t *barLayout)
Creates a touchable bar in main panel.
#define SPINNER_REFRESH_PERIOD
int nbgl_layoutAddTopRightButton(nbgl_layout_t *layout, const nbgl_icon_details_t *icon, uint8_t token, tune_index_e tuneId)
Creates a Top-right button in the top right corner of the top panel.
int nbgl_layoutInvertBackground(nbgl_layout_t *layout)
Inverts the background color (black instead of white)
int nbgl_layoutAddSwipe(nbgl_layout_t *layout, uint16_t swipesMask, const char *text, uint8_t token, tune_index_e tuneId)
Creates a swipe interaction on the main container.
int nbgl_layoutAddSwitch(nbgl_layout_t *layout, const nbgl_layoutSwitch_t *switchLayout)
Creates a switch with the given text and its state.
int nbgl_layoutAddHorizontalButtons(nbgl_layout_t *layout, const nbgl_layoutHorizontalButtons_t *info)
Creates two buttons to make a choice. Both buttons are mandatory The left one contains only an icon a...
int nbgl_layoutAddButton(nbgl_layout_t *layout, const nbgl_layoutButton_t *buttonInfo)
Creates a rounded button in the main container.
nbgl_layout_t * nbgl_layoutGet(const nbgl_layoutDescription_t *description)
returns a layout of the given type. The layout is reset
int nbgl_layoutAddExtendedFooter(nbgl_layout_t *layout, const nbgl_layoutFooter_t *footerDesc)
Creates a touchable area at the footer of the screen, containing various controls,...
int nbgl_layoutAddLeftContent(nbgl_layout_t *layout, const nbgl_layoutLeftContent_t *info)
Creates an area with a title, and rows of icon + text, left aligned.
int nbgl_layoutAddChoiceButtons(nbgl_layout_t *layout, const nbgl_layoutChoiceButtons_t *info)
Creates two buttons to make a choice. Both buttons are mandatory. Both buttons are full width,...
int nbgl_layoutRelease(nbgl_layout_t *layoutParam)
Release the layout obtained with nbgl_layoutGet()
int nbgl_layoutAddSpinner(nbgl_layout_t *layout, const char *text, const char *subText, uint8_t initPosition)
Creates a centered (vertically & horizontally) spinner with a text under it.
int nbgl_layoutUpdateSpinner(nbgl_layout_t *layout, const char *text, const char *subText, uint8_t position)
Update an existing spinner (must be the only object of the layout)
int nbgl_layoutAddLongPressButton(nbgl_layout_t *layout, const char *text, uint8_t token, tune_index_e tuneId)
Creates a long press button in the main container.
void layoutAddObject(nbgl_layoutInternal_t *layout, nbgl_obj_t *obj)
adds the given obj to the main container
int nbgl_layoutAddProgressBar(nbgl_layout_t *layout, const char *text, const char *subText, uint8_t percentage)
Creates an area in main panel to display a progress bar, with a title text and a subtext if needed.
int nbgl_layoutAddHeader(nbgl_layout_t *layout, const nbgl_layoutHeader_t *headerDesc)
Creates a touchable (or not) area at the header of the screen, containing various controls,...
int nbgl_layoutAddBottomButton(nbgl_layout_t *layout, const nbgl_icon_details_t *icon, uint8_t token, bool separationLine, tune_index_e tuneId)
Creates a centered button at bottom of main container.
#define HOLD_TO_APPROVE_STEP_DURATION_MS
int nbgl_layoutAddFooter(nbgl_layout_t *layout, const char *text, uint8_t token, tune_index_e tuneId)
Creates a touchable text at the footer of the screen, separated with a thin line from the rest of the...
int nbgl_layoutAddLargeCaseText(nbgl_layout_t *layout, const char *text, bool grayedOut)
Creates an area with given text in 32px font (in Black or Light Gray)
layoutObj_t * layoutAddCallbackObj(nbgl_layoutInternal_t *layout, nbgl_obj_t *obj, uint8_t token, tune_index_e tuneId)
void(* nbgl_layoutTouchCallback_t)(int token, uint8_t index)
prototype of function to be called when an object is touched
@ WHITE_BACKGROUND
rounded bordered button, with text/icon in black, on white background
@ NO_BORDER
simple clickable text, in black
@ BLACK_BACKGROUND
rounded bordered button, with text/icon in white, on black background
@ UP_FOOTER_TEXT
grayed-out text, for example "Tap to continue"
@ UP_FOOTER_BUTTON
simple button
@ UP_FOOTER_LONG_PRESS
long-press button
@ UP_FOOTER_TIP_BOX
Tip-box.
@ UP_FOOTER_HORIZONTAL_BUTTONS
2 buttons, on the same line
void * nbgl_layout_t
type shared externally
@ HEADER_TITLE
simple centered text
@ HEADER_BACK_AND_PROGRESS
optional back key and progress indicator (only on Stax)
@ HEADER_EMPTY
empty space, to have a better vertical centering of centered info
@ HEADER_EXTENDED_BACK
back key, centered text and touchable key on the right
@ HEADER_BACK_AND_TEXT
back key and optional text
@ HEADER_RIGHT_TEXT
touchable text on the right, with a vertical separation line
@ HEADER_BACK_ICON_AND_TEXT
back key and optional icon and text
#define NBGL_INVALID_TOKEN
#define SPINNER_FIXED
position to use for a "fixed" spinner
@ SOFT_ACTION_AND_FOOTER_STYLE
A white button on top of a footer, with a separation line.
@ BOTH_ROUNDED_STYLE
A black button on top of a white button.
@ ROUNDED_AND_FOOTER_STYLE
A black background button on top of a footer.
#define NBGL_NO_PROGRESS_INDICATOR
To be used when a control token shall not be used.
@ FOOTER_SIMPLE_TEXT
simple touchable text in bold
@ FOOTER_NAV
navigation bar
@ FOOTER_SIMPLE_BUTTON
simple black or white button (see nbgl_layoutButtonStyle_t)
@ FOOTER_DOUBLE_TEXT
2 touchable texts in bold, separated by a vertical line (only on Stax)
@ FOOTER_EMPTY
empty space, to have a better vertical centering of centered info
@ FOOTER_CHOICE_BUTTONS
double buttons (see nbgl_layoutChoiceButtonsStyle_t)
Internal functions/constants of NBGL layout layer.
@ SWIPE_USAGE_SUGGESTIONS
bool keyboardSwipeCallback(nbgl_obj_t *obj, nbgl_touchType_t eventType)
void layoutNavigationPopulate(nbgl_container_t *navContainer, const nbgl_layoutNavigationBar_t *navConfig, uint8_t layer)
This function creates a full navigation bar "object", with buttons and returns it as a container.
#define LAYOUT_OBJ_POOL_LEN
Max number of complex objects with callback retrievable from pool.
bool layoutNavigationCallback(nbgl_obj_t *obj, nbgl_touchType_t eventType, uint8_t nbPages, uint8_t *activePage)
function to be called when any of the controls in navigation bar is touched
API to draw all basic graphic objects.
struct PACKED__ nbgl_line_s nbgl_line_t
struct to represent a vertical or horizontal line
struct PACKED__ nbgl_navigation_bar_s nbgl_page_indicator_t
struct to represent a navigation bar (PAGE_INDICATOR type) There can be up to 5 page indicators,...
struct PACKED__ nbgl_radio_s nbgl_radio_t
struct to represent a radio button (RADIO_BUTTON type)
#define NB_SPINNER_POSITIONS
void(* nbgl_touchCallback_t)(void *obj, nbgl_touchType_t eventType)
prototype of function to be called when a touch event is received by an object
struct PACKED__ nbgl_text_area_s nbgl_text_area_t
struct to represent a text area (TEXT_AREA type)
void nbgl_objDraw(nbgl_obj_t *obj)
This function draws or redraws the given object and its children (recursive version)
struct PACKED__ nbgl_progress_bar_s nbgl_progress_bar_t
struct to represent a progress bar (PROGRESS_BAR type)
nbgl_obj_t ** nbgl_containerPoolGet(uint8_t nbObjs, uint8_t layer)
Gets a new container from the pool, with the given number of obj pointers.
nbgl_obj_t * nbgl_objPoolGet(nbgl_obj_type_t type, uint8_t layer)
Gets a new graphic object from the pool, with the given type. The type field of the object is set.
void nbgl_refreshSpecial(nbgl_refresh_mode_t mode)
This functions refreshes the actual screen on display with what has changed since the last refresh,...
struct PACKED__ nbgl_image_s nbgl_image_t
struct to represent an image (IMAGE type)
#define INACTIVE_SMALL_FONT
struct PACKED__ nbgl_button_s nbgl_button_t
struct to represent a button (BUTTON type) that can contain a text and/or an icon
#define INACTIVE_TEXT_COLOR
void nbgl_refreshSpecialWithPostRefresh(nbgl_refresh_mode_t mode, nbgl_post_refresh_t post_refresh)
struct PACKED__ nbgl_container_s nbgl_container_t
struct to represent a container (CONTAINER type)
struct PACKED__ nbgl_switch_s nbgl_switch_t
struct to represent a switch (size is fixed) (SWITCH type)
struct PACKED__ nbgl_obj_s nbgl_obj_t
Common structure for all graphical objects.
struct PACKED__ nbgl_spinner_s nbgl_spinner_t
struct to represent a "spinner", represented by the Ledger corners, in gray, with one of the corners ...
struct PACKED__ nbgl_qrcode_s nbgl_qrcode_t
struct to represent a QR code (QR_CODE type), whose size is fixed
int nbgl_screenSet(nbgl_obj_t ***elements, uint8_t nbElements, const nbgl_screenTickerConfiguration_t *ticker, nbgl_touchCallback_t touchCallback)
Configures the lowest layer screen. To be used by applications A nbgl_screenRedraw() can be called af...
int nbgl_screenPush(nbgl_obj_t ***elements, uint8_t nbElements, const nbgl_screenTickerConfiguration_t *ticker, nbgl_touchCallback_t touchCallback)
Pushes a screen on top of the stack, with the given number of elements, if possible....
void nbgl_wait_pipeline(void)
int nbgl_screenUpdateTicker(uint8_t screenIndex, const nbgl_screenTickerConfiguration_t *ticker)
Updates the ticker configuration of the screen at the given screenIndex, always set at WHITE in.
int nbgl_screenPop(uint8_t screenIndex)
Release the screen at the given index in screen array (index returned by nbgl_screenPush())....
struct PACKED__ nbgl_screenTickerConfiguration_s nbgl_screenTickerConfiguration_t
struct to configure a screen layer
int nbgl_screenUpdateBackgroundColor(uint8_t screenIndex, color_t color)
Updates the background color of the screen at the given screenIndex, always set at WHITE in.
void nbgl_screenRedraw(void)
This function redraws the whole screen on top of stack and its children.
uint32_t nbgl_touchGetTouchDuration(nbgl_obj_t *obj)
nbgl_state_t
to represent a boolean state.
@ POST_REFRESH_FORCE_POWER_OFF
Force screen power off after refresh.
@ POST_REFRESH_FORCE_POWER_ON
Force screen power on after refresh.
@ POST_REFRESH_FORCE_POWER_ON_WITH_PIPELINE
Force screen power on and enable pipeline.
nbgl_touchType_t
The different types of Touchscreen events.
@ TOUCHING
corresponding to an object that is currently touched
@ QRCODE_V10
QRCode V10, can encode text len up to 1500 chars, display size = 228*228.
@ QRCODE_V4_SMALL
QRCode V4, can encode text len up to 1500 chars, display size = 132*132.
@ QRCODE_V4
QRCode V4, can encode text len up to 62 chars, display size = 264*264.
@ VERTICAL
from top to bottom
@ HORIZONTAL
from left to right
@ LOOP_PARSING
0, 1, 2, 0, 1, 2, ...
struct PACKED__ nbgl_icon_details_s nbgl_icon_details_t
Represents all information about an icon.
@ NO_ALIGNMENT
used when parent container layout is used
@ RIGHT_TOP
on outside right
@ IMAGE
Bitmap (y and height must be multiple of 4 on Stax)
@ SWITCH
Switch to turn on/off something.
@ RADIO_BUTTON
Indicator to inform whether something is on or off.
@ BUTTON
Rounded rectangle button with icon and/or text.
@ PROGRESS_BAR
horizontal bar to indicate progression of something (between 0% and 100%)
@ PAGE_INDICATOR
horizontal bar to indicate position within pages
@ LINE
Vertical or Horizontal line.
@ CONTAINER
Empty container.
@ TEXT_AREA
Area to contain text line(s)
@ NBGL_BPP_1
1 bit per pixel
@ BLACK_AND_WHITE_REFRESH
to be used for pure B&W area, when contrast is important
@ BLACK_AND_WHITE_FAST_REFRESH
to be used for pure B&W area, when contrast is not priority
@ FULL_COLOR_PARTIAL_REFRESH
to be used for small partial refresh (radio buttons, switches)
const nbgl_icon_details_t * iconRight
const nbgl_icon_details_t * iconLeft
uint16_t delayMs
delay between 2 drawings
uint8_t nbIcons
number of icons in icons array
const nbgl_icon_details_t ** icons
array of nbIcons pointers on icons
nbgl_parsingType_t parsing
This structure contains info to build a centered (vertically and horizontally) area,...
uint16_t iconHug
vertical margin to apply on top and bottom of the icon
const nbgl_icon_details_t * icon
the icon (can be null)
const char * title
title in black large (can be null)
const char * description
description in black small regular case (can be null)
const char * subText
sub-text in dark gray regular small case
uint16_t animOffsetY
vertical offset of animation in icon if integrated (but usually 0)
bool padding
if true, apply a padding of 40px at the bottom
const nbgl_animation_t * animation
the animation (can be null), used if illustrType is ANIM_ILLUSTRATION
const char * smallTitle
sub-title in black small bold case (can be null)
uint16_t animOffsetX
horizontal offset of animation in icon if integrated (but usually 0)
nbgl_contentIllustrationType_t illustrType
This structure contains info to build a centered (vertically and horizontally) area,...
const char * text2
second text (can be null)
const char * text1
first text (can be null)
bool onTop
if set to true, align only horizontally
nbgl_contentCenteredInfoStyle_t style
style to apply to this info
int16_t offsetY
vertical shift to apply to this info (if >0, shift to bottom)
const char * text3
third text (can be null)
const nbgl_icon_details_t * icon
a buffer containing the 1BPP icon
This structure contains a list of names to build a list of radio buttons (on the right part of screen...
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played when selecting a radio button)
uint8_t token
the token that will be used as argument of the callback
bool localized
if set to true, use nameIds and not names
uint8_t initChoice
index of the current choice
const char *const * names
array of strings giving the choices (nbChoices)
uint8_t nbChoices
number of choices
This structure contains info to build a switch (on the right) with a description (on the left),...
const char * text
main text for the switch
uint8_t token
the token that will be used as argument of the callback (unused on Nano)
nbgl_state_t initState
initial state of the switch
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played
const char * subText
description under main text (NULL terminated, single line, may be null)
This structure contains a list of [tag,value] pairs.
const nbgl_contentTagValue_t * pairs
array of [tag,value] pairs (nbPairs items). If NULL, callback is used instead
nbgl_contentTagValueCallback_t callback
function to call to retrieve a given pair
uint8_t nbMaxLinesForValue
bool wrapping
if set to true, value text will be wrapped on ' ' to avoid cutting words
uint8_t startIndex
index of the first pair to get with callback
This structure contains a [tag,value] pair and possible extensions.
const nbgl_icon_details_t * valueIcon
const char * value
string giving the value name
const char * item
string giving the tag name
const char * text
text of the tip-box
const nbgl_icon_details_t * icon
icon of the tip-box
uint8_t token
token used when tip-box is tapped
tune_index_e tuneId
tune played when tip-box is tapped
structure defining an ASCII font
uint8_t line_height
height of a line for all characters in pixels
This structure contains info to build a clickable "bar" with a text and an icon.
bool inactive
if set to true, the bar is grayed-out and cannot be touched
const char * text
text (can be NULL)
uint8_t token
the token that will be used as argument of the callback
bool large
set to true only for the main level of OS settings
const char * subText
sub text (can be NULL)
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played
const nbgl_icon_details_t * iconLeft
a buffer containing the 1BPP icon for icon on left (can be NULL)
const nbgl_icon_details_t * iconRight
Structure containing all information when creating a layout. This structure must be passed as argumen...
nbgl_screenTickerConfiguration_t ticker
const char * tapActionText
Light gray text used when main container is "tapable".
nbgl_layoutTouchCallback_t onActionCallback
the callback to be called on any action on the layout
Structure containing all information about the current layout.
uint8_t nbUsedCallbackObjs
nbgl_container_t * footerContainer
container used to store footer (buttons, nav....)
uint8_t activePage
index of active page for navigation bar
uint8_t layer
layer in screen stack
nbgl_swipe_usage_t swipeUsage
nbgl_layoutTouchCallback_t callback
nbgl_container_t * container
uint8_t iconIdxInAnim
current icon index in animation
nbgl_container_t * headerContainer
container used to store header (progress, back, empty space...)
nbgl_layoutFooterType_t footerType
type of footer
uint8_t nbChildren
number of children in above array
nbgl_layoutHeaderType_t headerType
type of header
nbgl_container_t * upFooterContainer
uint8_t incrementAnim
if true, means that animation index is currently incrementing
uint8_t nbPages
number of pages for navigation bar
nbgl_layoutUpFooterType_t upFooterType
type of up-footer
uint8_t modal
if true, means the screen is a modal
layoutObj_t callbackObjPool[LAYOUT_OBJ_POOL_LEN]
nbgl_text_area_t * tapText
nbgl_obj_t ** children
children for main screen
const nbgl_animation_t * animation
current animation (if not NULL)
bool invertedColors
if true, means that background is black
This structure contains info to build a left content area.
uint8_t nbRows
number of rows in the area
const char * title
title of area in bold
const nbgl_icon_details_t ** rowIcons
array of nbRows icon
const char ** rowTexts
array of nbRows texts (displayed in regular)
This structure contains info to build a navigation bar at the bottom of the screen.
uint8_t activePage
index of active page (from 0 to nbPages-1).
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played when pressing keys)
bool withBackKey
if set to true, the "back" key is drawn
bool withExitKey
if set to true, an exit button is drawn (X on the left)
uint8_t token
the token that will be used as argument of the callback
uint8_t nbPages
number of pages. (if 0, no navigation)
This structure contains info to build a centered (vertically and horizontally) area,...
const char * text2
second text (can be null)
const char * text1
first text (can be null)
const char * url
URL for QR code.
bool largeText1
if set to true, use 32px font for text1
int16_t offsetY
vertical shift to apply to this info (if > 0, shift to bottom)
bool centered
if set to true, center vertically