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 SINGLE_BUTTON_MARGIN 24
68#define LONG_PRESS_PROGRESS_HEIGHT 8
69#define LONG_PRESS_PROGRESS_ALIGN 4
70#define TITLE_DESC_MARGIN 16
71#define LEFT_CONTENT_ICON_TEXT_X 16
72#elif defined(TARGET_FLEX)
73#define RADIO_CHOICE_HEIGHT 92
74#define BAR_INTERVALE 16
75#define FOOTER_BUTTON_HEIGHT 136
76#define FOOTER_IN_PAIR_HEIGHT 88
77#define ROUNDED_AND_FOOTER_FOOTER_HEIGHT 208
78#define FOOTER_TEXT_AND_NAV_WIDTH 192
79#define TAP_TO_CONTINUE_MARGIN 30
80#define SUB_HEADER_MARGIN 28
81#define PRE_FIRST_TEXT_MARGIN 0
82#define INTER_PARAGRAPHS_MARGIN 24
83#define PRE_TITLE_MARGIN 16
84#define PRE_DESCRIPTION_MARGIN 24
85#define PRE_FIRST_ROW_MARGIN 32
86#define INTER_ROWS_MARGIN 24
87#define QR_PRE_TEXT_MARGIN 24
88#define QR_INTER_TEXTS_MARGIN 28
89#define SPINNER_TEXT_MARGIN 24
90#define SPINNER_INTER_TEXTS_MARGIN 16
91#define BAR_TEXT_MARGIN 24
92#define BAR_INTER_TEXTS_MARGIN 16
93#define LEFT_CONTENT_TEXT_PADDING 4
94#define BUTTON_FROM_BOTTOM_MARGIN 4
95#define TOP_BUTTON_MARGIN VERTICAL_BORDER_MARGIN
96#define SINGLE_BUTTON_MARGIN 24
97#define LONG_PRESS_PROGRESS_HEIGHT 8
98#define LONG_PRESS_PROGRESS_ALIGN 4
99#define TITLE_DESC_MARGIN 16
100#define LEFT_CONTENT_ICON_TEXT_X 16
101#elif defined(TARGET_APEX)
102#define RADIO_CHOICE_HEIGHT 68
103#define BAR_INTERVALE 8
104#define FOOTER_BUTTON_HEIGHT 72
105#define FOOTER_IN_PAIR_HEIGHT 60
106#define ROUNDED_AND_FOOTER_FOOTER_HEIGHT 128
107#define FOOTER_TEXT_AND_NAV_WIDTH 120
108#define TAP_TO_CONTINUE_MARGIN 30
109#define SUB_HEADER_MARGIN 16
110#define PRE_FIRST_TEXT_MARGIN 0
111#define INTER_PARAGRAPHS_MARGIN 16
112#define PRE_TITLE_MARGIN 16
113#define PRE_DESCRIPTION_MARGIN 12
114#define PRE_FIRST_ROW_MARGIN 24
115#define INTER_ROWS_MARGIN 12
116#define QR_PRE_TEXT_MARGIN 16
117#define QR_INTER_TEXTS_MARGIN 20
118#define SPINNER_TEXT_MARGIN 16
119#define SPINNER_INTER_TEXTS_MARGIN 16
120#define BAR_TEXT_MARGIN 16
121#define BAR_INTER_TEXTS_MARGIN 12
122#define LEFT_CONTENT_TEXT_PADDING 4
123#define BUTTON_FROM_BOTTOM_MARGIN 0
124#define TOP_BUTTON_MARGIN 12
125#define SINGLE_BUTTON_MARGIN 16
126#define LONG_PRESS_PROGRESS_HEIGHT 4
127#define LONG_PRESS_PROGRESS_ALIGN 4
128#define TITLE_DESC_MARGIN 12
129#define LEFT_CONTENT_ICON_TEXT_X 8
131#error Undefined target
135#define SPINNER_REFRESH_PERIOD 400
179static uint8_t nbTouchableControls = 0;
186#ifdef HAVE_FAST_HOLD_TO_APPROVE
188#define HOLD_TO_APPROVE_STEP_PERCENT (7)
192#define HOLD_TO_APPROVE_STEP_DURATION_MS (100)
194#define HOLD_TO_APPROVE_STEP_PERCENT (25)
195#define HOLD_TO_APPROVE_STEP_DURATION_MS (400)
198static inline uint8_t get_hold_to_approve_percent(uint32_t touch_duration)
200#ifdef HAVE_FAST_HOLD_TO_APPROVE
209static bool getLayoutAndLayoutObj(
nbgl_obj_t *obj,
219 if (gLayout[i].nbChildren > 0) {
224 if (obj == gLayout[i].callbackObjPool[j].obj) {
226 "getLayoutAndLayoutObj(): obj found in layout[%d], index = %d, "
227 "nbUsedCallbackObjs = %d\n",
230 gLayout[i].nbUsedCallbackObjs);
231 *layout = &gLayout[i];
242static void radioTouchCallback(
nbgl_obj_t *obj,
255 bool needRefresh =
false;
261 if (getLayoutAndLayoutObj(obj, &layout, &layoutObj) ==
false) {
263 if (getLayoutAndLayoutObj(obj->parent, &layout, &layoutObj) ==
false) {
266 "touchCallback(): eventType = %d, obj = %p, no active layout or obj not found\n",
284 layoutObj->
index = eventType;
333 layoutObj->
index = lSwitch->state;
339 radioTouchCallback(obj, eventType, layout);
346 longTouchCallback(obj, eventType, layout, layoutObj);
351#ifdef HAVE_PIEZO_SOUND
353 os_io_seph_cmd_piezo_play_tune(layoutObj->
tuneId);
374 "longTouchCallback(): eventType = %d, obj = %p, gLayout[1].nbChildren = %d\n",
377 gLayout[1].nbChildren);
384 uint8_t new_state = get_hold_to_approve_percent(touchDuration);
388 bool trigger_callback = (new_state >= 100) && (progressBar->state < 100);
391 if (new_state >= 100) {
396 if (new_state != progressBar->state) {
397 progressBar->partialRedraw =
true;
398 progressBar->state = new_state;
407 if (trigger_callback) {
418 progressBar->partialRedraw =
true;
419 progressBar->state = 0;
426static void radioTouchCallback(
nbgl_obj_t *obj,
430 uint8_t i =
NB_MAX_LAYOUTS, radioIndex = 0, foundRadio = 0xFF, foundRadioIndex;
438 while (i < layout->nbUsedCallbackObjs) {
448 foundRadioIndex = radioIndex;
450 textArea->textColor =
BLACK;
451 textArea->fontId = SMALL_BOLD_FONT;
473 textArea->fontId = SMALL_REGULAR_FONT;
481 if (foundRadio != 0xFF) {
483#ifdef HAVE_PIEZO_SOUND
495static void spinnerTickerCallback(
void)
502 if (gLayout[1].nbChildren > 0) {
503 layout = &gLayout[1];
506 layout = &gLayout[0];
510 while (i < layout->container->nbChildren) {
513 if (container->nbChildren && (container->children[0]->type ==
SPINNER)) {
518 spinner->position = 0;
530static void animTickerCallback(
void)
537 if (gLayout[1].nbChildren > 0) {
538 layout = &gLayout[1];
541 layout = &gLayout[0];
549 while (i < layout->container->nbChildren) {
552 if (container->children[1]->type ==
IMAGE) {
591static nbgl_line_t *createHorizontalLine(uint8_t layer)
597 line->obj.area.width = SCREEN_WIDTH;
598 line->obj.area.height = 1;
605static nbgl_line_t *createLeftVerticalLine(uint8_t layer)
611 line->obj.area.width = 1;
612 line->obj.area.height = SCREEN_HEIGHT;
632 layoutObj->
obj = obj;
633 layoutObj->
token = token;
634 layoutObj->
tuneId = tuneId;
683 layoutInt->
container->obj.touchMask = swipesMask;
721 container->nbChildren = 0;
724 container->obj.area.height
725 = LIST_ITEM_MIN_TEXT_HEIGHT
726 + 2 * (itemDesc->
large ? LIST_ITEM_PRE_HEADING_LARGE : LIST_ITEM_PRE_HEADING);
728 container->obj.alignmentMarginX = BORDER_MARGIN;
730 container->obj.alignTo = NULL;
735 container->obj.touchMask = (1 <<
TOUCHED);
736 container->obj.touchId =
CONTROLS_ID + nbTouchableControls;
737 nbTouchableControls++;
741 if (itemDesc->
text != NULL) {
743 textArea->textColor = color;
744 textArea->text = PIC(itemDesc->
text);
745 textArea->onDrawCallback = NULL;
746 textArea->fontId = fontId;
747 textArea->wrapping =
true;
748 textArea->obj.area.width = container->obj.area.width;
751 textArea->obj.area.width
756 textArea->obj.area.width
760 textArea->obj.area.width -= SWITCH_ICON.width + BAR_INTERVALE;
762 textArea->obj.area.height =
MAX(
763 LIST_ITEM_MIN_TEXT_HEIGHT,
765 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping));
768 textArea->obj.alignmentMarginY
769 = itemDesc->
large ? LIST_ITEM_PRE_HEADING_LARGE : LIST_ITEM_PRE_HEADING;
770 if (textArea->obj.area.height > LIST_ITEM_MIN_TEXT_HEIGHT) {
771 textArea->obj.alignmentMarginY
772 -= (textArea->obj.area.height - LIST_ITEM_MIN_TEXT_HEIGHT) / 2;
775 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
776 container->nbChildren++;
782 imageLeft->foregroundColor = color;
783 imageLeft->buffer = PIC(itemDesc->
iconLeft);
785 imageLeft->obj.alignment =
MID_LEFT;
786 imageLeft->obj.alignTo = (
nbgl_obj_t *) textArea;
787 imageLeft->obj.alignmentMarginX = BAR_INTERVALE;
788 container->children[container->nbChildren] = (
nbgl_obj_t *) imageLeft;
789 container->nbChildren++;
791 if (textArea != NULL) {
792 textArea->obj.alignmentMarginX = imageLeft->buffer->width + BAR_INTERVALE;
798 imageRight->foregroundColor = color;
799 imageRight->buffer = PIC(itemDesc->
iconRight);
802 imageRight->obj.alignmentMarginX = BAR_INTERVALE;
803 imageRight->obj.alignTo = (
nbgl_obj_t *) textArea;
805 container->children[container->nbChildren] = (
nbgl_obj_t *) imageRight;
806 container->nbChildren++;
810 switchObj->onColor =
BLACK;
812 switchObj->state = itemDesc->
state;
814 switchObj->obj.alignmentMarginX = BAR_INTERVALE;
815 switchObj->obj.alignTo = (
nbgl_obj_t *) textArea;
817 container->children[container->nbChildren] = (
nbgl_obj_t *) switchObj;
818 container->nbChildren++;
821 if (itemDesc->
subText != NULL) {
825 subTextArea->textColor = color;
826 subTextArea->text = PIC(itemDesc->
subText);
827 subTextArea->textAlignment =
MID_LEFT;
828 subTextArea->fontId = SMALL_REGULAR_FONT;
830 subTextArea->wrapping =
true;
831 if (itemDesc->
text != NULL) {
833 subTextArea->obj.alignTo = (
nbgl_obj_t *) textArea;
834 subTextArea->obj.alignmentMarginY = LIST_ITEM_HEADING_SUB_TEXT;
837 subTextArea->obj.alignment =
TOP_LEFT;
838 subTextArea->obj.alignmentMarginY = SUB_HEADER_MARGIN;
839 container->obj.area.height = SUB_HEADER_MARGIN;
842 subTextArea->obj.alignmentMarginX
845 subTextArea->obj.area.width = container->obj.area.width;
848 subTextArea->obj.area.width,
849 subTextArea->wrapping);
850 container->children[container->nbChildren] = (
nbgl_obj_t *) subTextArea;
851 container->nbChildren++;
852 container->obj.area.height
853 += subTextArea->obj.area.height + subTextArea->obj.alignmentMarginY;
875 uint16_t fullHeight = 0;
880 container->nbChildren = 0;
885 if (info->
icon != NULL) {
888 image->buffer = PIC(info->
icon);
890 image->obj.alignmentMarginY = info->
iconHug;
892 fullHeight += image->buffer->height + info->
iconHug;
893 container->children[container->nbChildren] = (
nbgl_obj_t *) image;
894 container->nbChildren++;
905 container->children[container->nbChildren] = (
nbgl_obj_t *) anim;
906 container->nbChildren++;
917 tickerCfg.tickerCallback = &animTickerCallback;
922 if (info->
title != NULL) {
925 textArea->text = PIC(info->
title);
926 textArea->textAlignment =
CENTER;
927 textArea->fontId = LARGE_MEDIUM_FONT;
928 textArea->wrapping =
true;
931 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
934 if (container->nbChildren > 0) {
937 textArea->obj.alignmentMarginY = ICON_TITLE_MARGIN + info->
iconHug;
943 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY;
945 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
946 container->nbChildren++;
953 textArea->textAlignment =
CENTER;
954 textArea->fontId = SMALL_BOLD_FONT;
955 textArea->wrapping =
true;
958 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
961 if (container->nbChildren > 0) {
963 textArea->obj.alignTo = (
nbgl_obj_t *) container->children[container->nbChildren - 1];
964 textArea->obj.alignmentMarginY = VERTICAL_BORDER_MARGIN;
965 if (container->children[container->nbChildren - 1]->type ==
IMAGE) {
966 textArea->obj.alignmentMarginY = VERTICAL_BORDER_MARGIN + info->
iconHug;
969 textArea->obj.alignmentMarginY = 16;
976 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY;
978 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
979 container->nbChildren++;
986 textArea->textAlignment =
CENTER;
987 textArea->fontId = SMALL_REGULAR_FONT;
988 textArea->wrapping =
true;
991 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
994 if (container->nbChildren > 0) {
996 textArea->obj.alignTo = (
nbgl_obj_t *) container->children[container->nbChildren - 1];
997 if (container->children[container->nbChildren - 1]->type ==
TEXT_AREA) {
999 textArea->obj.alignmentMarginY = TITLE_DESC_MARGIN;
1002 textArea->obj.alignmentMarginY = VERTICAL_BORDER_MARGIN + info->
iconHug;
1009 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY;
1011 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
1012 container->nbChildren++;
1018 textArea->text = PIC(info->
subText);
1019 textArea->textAlignment =
CENTER;
1020 textArea->fontId = SMALL_REGULAR_FONT;
1021 textArea->wrapping =
true;
1024 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1026 textArea->obj.area.height += 2 * 8;
1028 if (container->nbChildren > 0) {
1030 textArea->obj.alignTo = (
nbgl_obj_t *) container->children[container->nbChildren - 1];
1031 textArea->obj.alignmentMarginY = 16;
1032 if (container->children[container->nbChildren - 1]->type ==
IMAGE) {
1033 textArea->obj.alignmentMarginY += info->
iconHug;
1040 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY;
1042 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
1043 container->nbChildren++;
1046 container->obj.alignment =
CENTER;
1048 container->obj.area.height = fullHeight;
1050 container->obj.area.height += 40;
1074 if (description->
modal) {
1075 if (gLayout[1].nbChildren == 0) {
1076 layout = &gLayout[1];
1078 else if (gLayout[2].nbChildren == 0) {
1079 layout = &gLayout[2];
1085 layout = &gLayout[0];
1087 if (layout == NULL) {
1095 nbTouchableControls = 0;
1100 if (description->
modal) {
1114 layout->
container->obj.area.width = SCREEN_WIDTH;
1115 layout->
container->obj.area.height = SCREEN_HEIGHT;
1159 uint16_t swipesMask,
1162 tune_index_e tuneId)
1167 if (layout == NULL) {
1174 layoutInt->
tapText->text = PIC(text);
1176 layoutInt->
tapText->fontId = SMALL_REGULAR_FONT;
1180 layoutInt->
tapText->obj.alignmentMarginY = TAP_TO_CONTINUE_MARGIN;
1198 if (layout == NULL) {
1228 tune_index_e tuneId)
1235 if (layout == NULL) {
1246 button->radius = BUTTON_RADIUS;
1247 button->obj.alignmentMarginX = BORDER_MARGIN;
1248 button->obj.alignmentMarginY = BORDER_MARGIN;
1249 button->foregroundColor =
BLACK;
1250 button->innerColor =
WHITE;
1252 button->obj.touchMask = (1 <<
TOUCHED);
1254 button->icon = PIC(icon);
1299 bool separationLine,
1300 tune_index_e tuneId)
1329 if (layout == NULL) {
1333 if (barLayout->
text == NULL) {
1346 container = addListItem(layoutInt, &itemDesc);
1348 if (container == NULL) {
1351 return container->obj.area.height;
1368 if (layout == NULL) {
1372 if (switchLayout->
text == NULL) {
1376 itemDesc.
text = switchLayout->
text;
1381 itemDesc.
large =
false;
1383 container = addListItem(layoutInt, &itemDesc);
1385 if (container == NULL) {
1388 return container->obj.area.height;
1406 if (layout == NULL) {
1410 itemDesc.
text = text;
1415 container = addListItem(layoutInt, &itemDesc);
1417 if (container == NULL) {
1420 return container->obj.area.height;
1436 const char *subText,
1444 if (layout == NULL) {
1448 itemDesc.
text = text;
1451 itemDesc.
token = token;
1454 itemDesc.
index = index;
1456 container = addListItem(layoutInt, &itemDesc);
1458 if (container == NULL) {
1461 return container->obj.area.height;
1478 if (layout == NULL) {
1484 textArea->text = PIC(text);
1485 textArea->textAlignment =
MID_LEFT;
1486 textArea->fontId = LARGE_MEDIUM_FONT;
1488 textArea->wrapping =
true;
1490 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1493 textArea->obj.alignmentMarginX = BORDER_MARGIN;
1494 if (layoutInt->
container->nbChildren == 0) {
1496 textArea->obj.alignmentMarginY += PRE_FIRST_TEXT_MARGIN;
1499 textArea->obj.alignmentMarginY = INTER_PARAGRAPHS_MARGIN;
1522 const char *description,
1529 if (layout == NULL) {
1535 textArea->textColor =
BLACK;
1536 textArea->text = PIC(title);
1537 textArea->textAlignment =
MID_LEFT;
1538 textArea->fontId = LARGE_MEDIUM_FONT;
1540 textArea->wrapping =
true;
1542 textArea->obj.alignmentMarginX = BORDER_MARGIN;
1543 textArea->obj.alignmentMarginY = PRE_TITLE_MARGIN;
1546 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1552 textArea->textColor =
BLACK;
1553 textArea->text = PIC(description);
1554 textArea->fontId = SMALL_REGULAR_FONT;
1556 textArea->wrapping =
true;
1559 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1560 textArea->textAlignment =
MID_LEFT;
1562 textArea->obj.alignmentMarginX = BORDER_MARGIN;
1563 textArea->obj.alignmentMarginY = PRE_DESCRIPTION_MARGIN;
1570 textArea->text = PIC(info);
1571 textArea->fontId = SMALL_REGULAR_FONT;
1573 textArea->wrapping =
true;
1576 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1577 textArea->textAlignment =
MID_LEFT;
1579 textArea->obj.alignmentMarginX = BORDER_MARGIN;
1580 textArea->obj.alignmentMarginY = 40;
1584 return layoutInt->
container->obj.area.height;
1601 if (layout == NULL) {
1604 for (i = 0; i < choices->
nbChoices; i++) {
1621 container->nbChildren = 2;
1624 container->obj.area.height = RADIO_CHOICE_HEIGHT;
1626 container->obj.alignmentMarginX = BORDER_MARGIN;
1627 container->obj.alignTo = (
nbgl_obj_t *) NULL;
1630 button->activeColor =
BLACK;
1632 button->obj.alignTo = (
nbgl_obj_t *) container;
1635 container->children[1] = (
nbgl_obj_t *) button;
1639#ifdef HAVE_LANGUAGE_PACK
1640 textArea->text = get_ux_loc_string(choices->nameIds[i]);
1644 textArea->text = PIC(choices->
names[i]);
1646 textArea->textAlignment =
MID_LEFT;
1647 textArea->obj.area.width = container->obj.area.width - RADIO_WIDTH;
1649 textArea->obj.alignment =
MID_LEFT;
1650 textArea->obj.alignTo = (
nbgl_obj_t *) container;
1651 container->children[0] = (
nbgl_obj_t *) textArea;
1654 container->obj.touchMask = (1 <<
TOUCHED);
1655 container->obj.touchId =
CONTROLS_ID + nbTouchableControls;
1656 nbTouchableControls++;
1661 textArea->textColor =
BLACK;
1662 textArea->fontId = SMALL_BOLD_FONT;
1667 textArea->fontId = SMALL_REGULAR_FONT;
1671 line = createHorizontalLine(layoutInt->
layer);
1672 line->obj.alignmentMarginY = -1;
1697 if (layout == NULL) {
1704 if (info->
text1 != NULL) {
1712 if (info->
text2 != NULL) {
1720 if (info->
text3 != NULL) {
1728 container = addContentCenter(layoutInt, ¢eredInfo);
1731 container->obj.alignmentMarginX = BORDER_MARGIN;
1732 container->obj.alignmentMarginY = BORDER_MARGIN + info->
offsetY;
1736 container->obj.alignmentMarginY = info->
offsetY;
1739 return container->obj.area.height;
1756 if (layout == NULL) {
1760 container = addContentCenter(layoutInt, info);
1762 return container->obj.area.height;
1780 if (layout == NULL) {
1786 container->nbChildren = info->
nbRows + 1;
1790 container->obj.alignmentMarginX = BORDER_MARGIN;
1794 textArea->textColor =
BLACK;
1795 textArea->text = PIC(info->
title);
1796 textArea->textAlignment =
MID_LEFT;
1797 textArea->fontId = LARGE_MEDIUM_FONT;
1798 textArea->wrapping =
true;
1800 textArea->obj.alignmentMarginY = 24;
1804 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1806 container->obj.area.height += textArea->obj.area.height;
1808 container->children[0] = (
nbgl_obj_t *) textArea;
1810 for (row = 0; row < info->
nbRows; row++) {
1816 rowContainer->nbChildren = 2;
1821 image->foregroundColor =
BLACK;
1822 image->buffer = info->
rowIcons[row];
1823 rowContainer->children[0] = (
nbgl_obj_t *) image;
1826 textArea->textColor =
BLACK;
1827 textArea->text = info->
rowTexts[row];
1828 textArea->textAlignment =
MID_LEFT;
1829 textArea->fontId = SMALL_REGULAR_FONT;
1830 textArea->wrapping =
true;
1831 textArea->obj.area.width
1834 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1836 rowContainer->children[1] = (
nbgl_obj_t *) textArea;
1837 rowContainer->obj.area.height
1838 =
MAX(image->buffer->height, textArea->obj.area.height + LEFT_CONTENT_TEXT_PADDING);
1841 rowContainer->obj.alignmentMarginY = PRE_FIRST_ROW_MARGIN;
1844 rowContainer->obj.alignmentMarginY = INTER_ROWS_MARGIN;
1846 container->children[1 + row] = (
nbgl_obj_t *) rowContainer;
1847 container->obj.area.height
1848 += rowContainer->obj.area.height + rowContainer->obj.alignmentMarginY;
1852 return container->obj.area.height;
1870 uint16_t fullHeight = 0;
1873 if (layout == NULL) {
1881 container->nbChildren = 0;
1885 if (strlen(PIC(info->
url)) > 62) {
1908 fullHeight +=
qrcode->obj.area.height;
1910 container->nbChildren++;
1912 if (info->
text1 != NULL) {
1914 textArea->textColor =
BLACK;
1915 textArea->text = PIC(info->
text1);
1916 textArea->textAlignment =
CENTER;
1917 textArea->fontId = (info->
largeText1 ==
true) ? LARGE_MEDIUM_FONT : SMALL_REGULAR_FONT;
1918 textArea->wrapping =
true;
1921 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1923 textArea->obj.alignTo = (
nbgl_obj_t *) container->children[container->nbChildren - 1];
1924 textArea->obj.alignmentMarginY = QR_PRE_TEXT_MARGIN;
1926 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY;
1928 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
1929 container->nbChildren++;
1931 if (info->
text2 != NULL) {
1934 textArea->text = PIC(info->
text2);
1935 textArea->textAlignment =
CENTER;
1936 textArea->fontId = SMALL_REGULAR_FONT;
1937 textArea->wrapping =
true;
1940 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1942 textArea->obj.alignTo = (
nbgl_obj_t *) container->children[container->nbChildren - 1];
1943 if (info->
text1 != NULL) {
1944 textArea->obj.alignmentMarginY = QR_INTER_TEXTS_MARGIN;
1947 textArea->obj.alignmentMarginY = 32;
1950 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY + 8;
1952 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
1953 container->nbChildren++;
1956 if ((fullHeight >= (layoutInt->
container->obj.area.height - 16))
1964 container->obj.area.height = fullHeight;
1967 container->obj.alignment =
CENTER;
1971 container->obj.alignTo
1974 container->obj.alignmentMarginY = info->
offsetY;
2020 .horizontalButtons.leftIcon = info->
leftIcon,
2021 .horizontalButtons.leftToken = info->
leftToken,
2022 .horizontalButtons.rightText = info->
rightText,
2023 .horizontalButtons.rightToken = info->
rightToken,
2024 .horizontalButtons.tuneId = info->
tuneId};
2046 if (layout == NULL) {
2050 for (i = 0; i < list->
nbPairs; i++) {
2052 uint16_t fullHeight = 0;
2055 if (list->
pairs != NULL) {
2056 pair = &list->
pairs[i];
2073 itemTextArea->text = PIC(pair->
item);
2074 itemTextArea->textAlignment =
MID_LEFT;
2075 itemTextArea->fontId = SMALL_REGULAR_FONT;
2076 itemTextArea->wrapping =
true;
2079 itemTextArea->fontId, itemTextArea->text,
AVAILABLE_WIDTH, itemTextArea->wrapping);
2082 itemTextArea->obj.alignmentMarginX = 0;
2083 itemTextArea->obj.alignmentMarginY = 0;
2084 itemTextArea->obj.alignTo = NULL;
2085 container->children[container->nbChildren] = (
nbgl_obj_t *) itemTextArea;
2086 container->nbChildren++;
2088 fullHeight += itemTextArea->obj.area.height;
2091 valueTextArea->textColor =
BLACK;
2092 valueTextArea->text = PIC(pair->
value);
2093 valueTextArea->textAlignment =
MID_LEFT;
2095 valueTextArea->fontId = SMALL_BOLD_FONT;
2098 valueTextArea->fontId = LARGE_MEDIUM_FONT;
2106 valueIcon = &MINI_PUSH_ICON;
2113 valueTextArea->obj.area.width =
AVAILABLE_WIDTH - valueIcon->width - 12;
2119 valueTextArea->text,
2120 valueTextArea->obj.area.width,
2128 valueTextArea->obj.area.height = nbLines * font->
line_height;
2131 valueTextArea->obj.alignmentMarginY = 4;
2132 valueTextArea->obj.alignTo = (
nbgl_obj_t *) itemTextArea;
2133 valueTextArea->wrapping = list->
wrapping;
2134 container->children[container->nbChildren] = (
nbgl_obj_t *) valueTextArea;
2135 container->nbChildren++;
2137 fullHeight += valueTextArea->obj.area.height + valueTextArea->obj.alignmentMarginY;
2138 if (valueIcon != NULL) {
2143 image->foregroundColor =
BLACK;
2144 image->buffer = valueIcon;
2146 image->obj.alignmentMarginX = 12;
2147 image->obj.alignTo = (
nbgl_obj_t *) valueTextArea;
2148 image->obj.touchMask = (1 <<
TOUCHED);
2151 container->children[container->nbChildren] = (
nbgl_obj_t *) image;
2152 container->nbChildren++;
2156 container->obj.area.height = fullHeight;
2158 container->obj.alignmentMarginX = BORDER_MARGIN;
2160 container->obj.alignmentMarginY = INTER_TAG_VALUE_MARGIN;
2163 container->obj.alignmentMarginY = PRE_TAG_VALUE_MARGIN;
2187 const char *subText,
2196 if (layout == NULL) {
2203 container->nbChildren = (subText != NULL) ? 3 : 2;
2208 container->obj.alignment =
CENTER;
2212 progress->foregroundColor =
BLACK;
2213 progress->withBorder =
true;
2214 progress->state = percentage;
2215 progress->obj.area.width = PROGRESSBAR_WIDTH;
2216 progress->obj.area.height = PROGRESSBAR_HEIGHT;
2220 container->children[0] = (
nbgl_obj_t *) progress;
2223 container->obj.area.height = progress->obj.alignmentMarginY + progress->obj.area.height;
2227 textArea->textColor =
BLACK;
2228 textArea->text = PIC(text);
2229 textArea->textAlignment =
CENTER;
2230 textArea->fontId = LARGE_MEDIUM_FONT;
2231 textArea->wrapping =
true;
2232 textArea->obj.alignmentMarginY = BAR_TEXT_MARGIN;
2233 textArea->obj.alignTo = (
nbgl_obj_t *) progress;
2237 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
2241 container->obj.area.height += textArea->obj.alignmentMarginY + textArea->obj.area.height;
2244 container->children[1] = (
nbgl_obj_t *) textArea;
2246 if (subText != NULL) {
2250 subTextArea->textColor =
BLACK;
2251 subTextArea->text = PIC(subText);
2252 subTextArea->textAlignment =
CENTER;
2253 subTextArea->fontId = SMALL_REGULAR_FONT;
2254 subTextArea->wrapping =
true;
2255 subTextArea->obj.alignmentMarginY = BAR_INTER_TEXTS_MARGIN;
2256 subTextArea->obj.alignTo = (
nbgl_obj_t *) textArea;
2261 subTextArea->obj.area.width,
2262 subTextArea->wrapping);
2266 container->obj.area.height
2267 += subTextArea->obj.alignmentMarginY + subTextArea->obj.area.height;
2270 container->children[2] = (
nbgl_obj_t *) subTextArea;
2273 container->obj.area.height = (container->obj.area.height + 7) & 0xFFF8;
2292 line = createHorizontalLine(layoutInt->
layer);
2293 line->obj.alignmentMarginY = -1;
2312 if (layout == NULL) {
2348 button->obj.alignmentMarginX = BORDER_MARGIN;
2349 button->obj.alignmentMarginY = 12;
2352 button->innerColor =
BLACK;
2353 button->foregroundColor =
WHITE;
2356 button->innerColor =
WHITE;
2357 button->foregroundColor =
BLACK;
2360 button->borderColor =
WHITE;
2364 button->borderColor =
BLACK;
2370 button->text = PIC(buttonInfo->
text);
2371 button->fontId = SMALL_BOLD_FONT;
2372 button->icon = PIC(buttonInfo->
icon);
2375 + SMALL_BUTTON_HEIGHT
2376 + ((button->icon) ? (button->icon->width + 12) : 0);
2377 button->obj.area.height = SMALL_BUTTON_HEIGHT;
2378 button->radius = SMALL_BUTTON_RADIUS_INDEX;
2379 if (buttonInfo->
onBottom !=
true) {
2380 button->obj.alignmentMarginX += (
AVAILABLE_WIDTH - button->obj.area.width) / 2;
2386 button->radius = BUTTON_RADIUS;
2388 button->obj.alignTo = NULL;
2389 button->obj.touchMask = (1 <<
TOUCHED);
2409 tune_index_e tuneId)
2412 .longPress.text = text,
2413 .longPress.token = token,
2414 .longPress.tuneId = tuneId};
2417 if (layout == NULL) {
2437 tune_index_e tuneId)
2462 const char *leftText,
2464 const char *rightText,
2466 tune_index_e tuneId)
2497 if (layout == NULL) {
2511 switch (headerDesc->
type) {
2542 button->innerColor =
WHITE;
2544 button->borderColor =
WHITE;
2545 button->obj.area.width = BACK_KEY_WIDTH;
2546 button->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2547 button->text = NULL;
2548 button->icon = PIC(&LEFT_ARROW_ICON);
2561 image->foregroundColor =
BLACK;
2562 image->obj.alignment =
CENTER;
2577 textArea->obj.touchMask = (1 <<
TOUCHED);
2579 textArea->obj.alignment =
CENTER;
2580 textArea->textColor =
BLACK;
2581 textArea->obj.area.width
2585 textArea->obj.area.width -= 16 + image->buffer->width;
2587 textArea->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2588 textArea->text = text;
2589 textArea->fontId = SMALL_BOLD_FONT;
2590 textArea->textAlignment =
CENTER;
2591 textArea->wrapping =
true;
2596 textArea->obj.area.width,
2600 "nbgl_layoutAddHeader: text [%s] is too long for header\n",
2611 textArea->obj.alignmentMarginX = 8 + image->buffer->width / 2;
2612 image->obj.alignmentMarginX = -8 - textArea->obj.area.width / 2;
2628 actionButton->obj.touchMask = (1 <<
TOUCHED);
2631 actionButton->obj.alignment =
MID_RIGHT;
2632 actionButton->innerColor =
WHITE;
2633 button->foregroundColor
2636 actionButton->borderColor =
WHITE;
2637 actionButton->obj.area.width = BACK_KEY_WIDTH;
2638 actionButton->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2639 actionButton->text = NULL;
2647 layoutInt->
headerContainer->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2653 line = createHorizontalLine(layoutInt->
layer);
2655 line->obj.alignmentMarginY = TOUCHABLE_HEADER_BAR_HEIGHT;
2661 subTextArea->textColor =
BLACK;
2663 subTextArea->textAlignment =
MID_LEFT;
2664 subTextArea->fontId = SMALL_REGULAR_FONT;
2665 subTextArea->wrapping =
true;
2667 subTextArea->obj.alignmentMarginY = SUB_HEADER_MARGIN;
2669 subTextArea->obj.area.height
2672 subTextArea->obj.area.width,
2673 subTextArea->wrapping);
2678 += subTextArea->obj.area.height + 2 * SUB_HEADER_MARGIN;
2680 if (button != NULL) {
2681 button->obj.alignmentMarginY
2682 -= (subTextArea->obj.area.height + 2 * SUB_HEADER_MARGIN) / 2;
2684 if (textArea != NULL) {
2685 textArea->obj.alignmentMarginY
2686 -= (subTextArea->obj.area.height + 2 * SUB_HEADER_MARGIN) / 2;
2688 if (actionButton != NULL) {
2689 actionButton->obj.alignmentMarginY
2690 -= (subTextArea->obj.area.height + 2 * SUB_HEADER_MARGIN) / 2;
2709 button->innerColor =
WHITE;
2710 button->foregroundColor =
BLACK;
2711 button->borderColor =
WHITE;
2712 button->obj.area.width = BACK_KEY_WIDTH;
2713 button->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2714 button->text = NULL;
2715 button->icon = PIC(&LEFT_ARROW_ICON);
2716 button->obj.touchMask = (1 <<
TOUCHED);
2733 progress->obj.area.width = 224;
2734 progress->obj.alignment =
CENTER;
2742 layoutInt->
headerContainer->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2748 textArea->textColor =
BLACK;
2750 textArea->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2751 textArea->text = PIC(headerDesc->
title.
text);
2752 textArea->fontId = SMALL_BOLD_FONT;
2753 textArea->textAlignment =
CENTER;
2754 textArea->wrapping =
true;
2758 layoutInt->
headerContainer->obj.area.height = textArea->obj.area.height;
2771 textArea->obj.alignmentMarginX = BORDER_MARGIN;
2772 textArea->textColor =
BLACK;
2774 textArea->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2776 textArea->fontId = SMALL_BOLD_FONT;
2778 textArea->obj.touchMask = (1 <<
TOUCHED);
2784 layoutInt->
headerContainer->obj.area.height = textArea->obj.area.height;
2792 line = createHorizontalLine(layoutInt->
layer);
2828 if (layout == NULL) {
2842 switch (footerDesc->
type) {
2860 textArea->obj.area.height
2865 textArea->textAlignment =
CENTER;
2866 textArea->obj.touchMask = (1 <<
TOUCHED);
2871 layoutInt->
footerContainer->obj.area.height = textArea->obj.area.height;
2884 textArea->textColor =
BLACK;
2886 textArea->obj.area.height = SIMPLE_FOOTER_HEIGHT;
2888 textArea->fontId = SMALL_BOLD_FONT;
2889 textArea->textAlignment =
CENTER;
2890 textArea->obj.touchMask = (1 <<
TOUCHED);
2908 textArea->textColor =
BLACK;
2910 textArea->obj.area.height = SIMPLE_FOOTER_HEIGHT;
2912 textArea->fontId = SMALL_BOLD_FONT;
2913 textArea->textAlignment =
CENTER;
2914 textArea->obj.touchMask = (1 <<
TOUCHED);
2920 layoutInt->
footerContainer->obj.area.height = textArea->obj.area.height;
2925 separationLine->obj.area.width = 1;
2926 separationLine->obj.area.height = layoutInt->
footerContainer->obj.area.height;
2927 separationLine->direction =
VERTICAL;
2928 separationLine->thickness = 1;
2929 separationLine->obj.alignment =
MID_LEFT;
2930 separationLine->obj.alignTo = (
nbgl_obj_t *) textArea;
2931 separationLine->obj.alignmentMarginX = -1;
2947 textArea->textColor =
BLACK;
2948 textArea->obj.area.width = FOOTER_TEXT_AND_NAV_WIDTH;
2949 textArea->obj.area.height = SIMPLE_FOOTER_HEIGHT;
2951 textArea->fontId = SMALL_BOLD_FONT;
2952 textArea->textAlignment =
CENTER;
2953 textArea->obj.touchMask = (1 <<
TOUCHED);
2965 navContainer->nbChildren = 4;
2966 navContainer->children
2969 navContainer->obj.area.width = SCREEN_WIDTH - textArea->obj.area.width;
2970 navContainer->obj.area.height = SIMPLE_FOOTER_HEIGHT;
2983 separationLine->obj.area.width = 1;
2984 separationLine->obj.area.height = layoutInt->
footerContainer->obj.area.height;
2985 separationLine->direction =
VERTICAL;
2986 separationLine->thickness = 1;
2987 separationLine->obj.alignment =
MID_LEFT;
2988 separationLine->obj.alignTo = (
nbgl_obj_t *) navContainer;
2989 separationLine->obj.alignmentMarginX = -1;
3028 button->obj.alignmentMarginY = SINGLE_BUTTON_MARGIN;
3030 button->innerColor =
BLACK;
3031 button->foregroundColor =
WHITE;
3034 button->innerColor =
WHITE;
3035 button->foregroundColor =
BLACK;
3039 button->borderColor =
WHITE;
3043 button->borderColor =
BLACK;
3050 button->fontId = SMALL_BOLD_FONT;
3052 button->radius = BUTTON_RADIUS;
3061 button->obj.touchMask = (1 <<
TOUCHED);
3089 button->innerColor =
WHITE;
3092 button->obj.alignmentMarginY
3093 = VERTICAL_BORDER_MARGIN;
3097 button->obj.alignmentMarginY
3098 = BUTTON_FROM_BOTTOM_MARGIN;
3099 button->borderColor =
WHITE;
3101 button->foregroundColor =
BLACK;
3103 button->obj.area.height = FOOTER_IN_PAIR_HEIGHT;
3104 button->radius = BUTTON_RADIUS;
3106 button->fontId = SMALL_BOLD_FONT;
3107 button->obj.touchMask = (1 <<
TOUCHED);
3117 line = createHorizontalLine(layoutInt->
layer);
3137 button->obj.alignmentMarginY = TOP_BUTTON_MARGIN;
3139 button->innerColor =
WHITE;
3141 button->foregroundColor =
BLACK;
3144 button->innerColor =
BLACK;
3145 button->borderColor =
BLACK;
3146 button->foregroundColor =
WHITE;
3150 button->radius = BUTTON_RADIUS;
3155 button->fontId = SMALL_BOLD_FONT;
3156 button->obj.touchMask = (1 <<
TOUCHED);
3164 layoutInt->
footerContainer->obj.area.height = ACTION_AND_FOOTER_FOOTER_HEIGHT;
3167 layoutInt->
footerContainer->obj.area.height = ROUNDED_AND_FOOTER_FOOTER_HEIGHT;
3178 addSwipeInternal(layoutInt,
3189 line = createHorizontalLine(layoutInt->
layer);
3195 if (separationLine != NULL) {
3228 if (layout == NULL) {
3245 switch (upFooterDesc->
type) {
3264 button->obj.alignmentMarginX = BORDER_MARGIN;
3266 button->innerColor =
BLACK;
3267 button->foregroundColor =
WHITE;
3268 button->borderColor =
BLACK;
3271 button->radius = BUTTON_RADIUS;
3272 button->icon = PIC(&VALIDATE_ICON);
3276 textArea->textColor =
BLACK;
3278 textArea->textAlignment =
MID_LEFT;
3279 textArea->fontId = LARGE_MEDIUM_FONT;
3280 textArea->wrapping =
true;
3281 textArea->obj.area.width = SCREEN_WIDTH - 3 * BORDER_MARGIN - button->obj.area.width;
3283 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
3285 textArea->obj.alignment =
MID_LEFT;
3286 textArea->obj.alignmentMarginX = BORDER_MARGIN;
3289 line = createHorizontalLine(layoutInt->
layer);
3291 line->obj.alignmentMarginY = VERTICAL_ALIGNMENT - 1;
3295 progressBar->obj.area.width = SCREEN_WIDTH;
3296 progressBar->obj.area.height = LONG_PRESS_PROGRESS_HEIGHT;
3298 progressBar->obj.alignmentMarginY = LONG_PRESS_PROGRESS_ALIGN;
3299 progressBar->resetIfOverriden =
true;
3315 button->obj.alignment =
CENTER;
3318 button->innerColor =
BLACK;
3319 button->foregroundColor =
WHITE;
3322 button->innerColor =
WHITE;
3323 button->foregroundColor =
BLACK;
3326 button->borderColor =
WHITE;
3330 button->borderColor =
BLACK;
3336 button->text = PIC(upFooterDesc->
button.
text);
3337 button->fontId = SMALL_BOLD_FONT;
3338 button->icon = PIC(upFooterDesc->
button.
icon);
3341 button->radius = BUTTON_RADIUS;
3343 button->obj.alignTo = NULL;
3344 button->obj.touchMask = (1 <<
TOUCHED);
3371 button->obj.alignmentMarginX = BORDER_MARGIN;
3373 button->innerColor =
WHITE;
3374 button->foregroundColor =
BLACK;
3377 button->radius = BUTTON_RADIUS;
3379 button->fontId = SMALL_BOLD_FONT;
3380 button->obj.touchMask = (1 <<
TOUCHED);
3396 button->obj.alignmentMarginX = BORDER_MARGIN;
3397 button->innerColor =
BLACK;
3398 button->borderColor =
BLACK;
3399 button->foregroundColor =
WHITE;
3402 button->radius = BUTTON_RADIUS;
3404 button->fontId = SMALL_BOLD_FONT;
3405 button->obj.touchMask = (1 <<
TOUCHED);
3427 textArea->textColor =
BLACK;
3428 textArea->text = PIC(upFooterDesc->
tipBox.
text);
3429 textArea->textAlignment =
MID_LEFT;
3430 textArea->fontId = SMALL_REGULAR_FONT;
3431 textArea->wrapping =
true;
3434 textArea->obj.area.width
3439 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
3440 textArea->obj.alignment =
MID_LEFT;
3441 textArea->obj.alignmentMarginX = BORDER_MARGIN;
3445 line = createHorizontalLine(layoutInt->
layer);
3451 image->obj.alignmentMarginX = BORDER_MARGIN;
3453 image->foregroundColor =
BLACK;
3454 image->buffer = PIC(upFooterDesc->
tipBox.
icon);
3467 upFooterDesc->
text.token,
3468 upFooterDesc->
text.tuneId);
3478 if (strlen(PIC(upFooterDesc->
text.text))) {
3481 textArea->text = PIC(upFooterDesc->
text.text);
3482 textArea->textAlignment =
CENTER;
3483 textArea->fontId = SMALL_REGULAR_FONT;
3484 textArea->wrapping =
true;
3487 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
3488 textArea->obj.alignment =
CENTER;
3525 tune_index_e tuneId)
3528 .separationLine =
false,
3529 .progressAndBack.activePage = activePage,
3530 .progressAndBack.nbPages = nbPages,
3531 .progressAndBack.token = backToken,
3532 .progressAndBack.tuneId = tuneId,
3533 .progressAndBack.withBack = withBack,
3534 .progressAndBack.actionIcon = NULL,
3553 const char *subText,
3554 uint8_t initPosition)
3562 if (layout == NULL) {
3568 container->nbChildren = 3;
3573 container->obj.alignment =
CENTER;
3577 spinner->position = initPosition;
3580 container->children[0] = (
nbgl_obj_t *) spinner;
3583 container->obj.area.height += SPINNER_HEIGHT;
3587 textArea->textColor =
BLACK;
3588 textArea->text = PIC(text);
3589 textArea->textAlignment =
CENTER;
3590 textArea->fontId = (subText != NULL) ? LARGE_MEDIUM_FONT : SMALL_REGULAR_FONT;
3591 textArea->wrapping =
true;
3592 textArea->obj.alignmentMarginY = SPINNER_TEXT_MARGIN;
3593 textArea->obj.alignTo = (
nbgl_obj_t *) spinner;
3597 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
3601 container->obj.area.height += textArea->obj.alignmentMarginY + textArea->obj.area.height;
3604 container->children[1] = (
nbgl_obj_t *) textArea;
3606 if (subText != NULL) {
3610 subTextArea->textColor =
BLACK;
3611 subTextArea->text = PIC(subText);
3612 subTextArea->textAlignment =
CENTER;
3613 subTextArea->fontId = SMALL_REGULAR_FONT;
3614 subTextArea->wrapping =
true;
3615 subTextArea->obj.alignmentMarginY = SPINNER_INTER_TEXTS_MARGIN;
3616 subTextArea->obj.alignTo = (
nbgl_obj_t *) textArea;
3621 subTextArea->obj.area.width,
3622 subTextArea->wrapping);
3626 container->obj.area.height
3627 += subTextArea->obj.alignmentMarginY + subTextArea->obj.area.height;
3630 container->children[2] = (
nbgl_obj_t *) subTextArea;
3640 tickerCfg.tickerCallback = &spinnerTickerCallback;
3660 const char *subText,
3670 if ((layout == NULL) || (layoutInt->
container->nbChildren == 0)) {
3675 if ((container->obj.type !=
CONTAINER) || (container->nbChildren < 2)) {
3680 if (spinner->obj.type !=
SPINNER) {
3684 if (spinner->position != position) {
3685 spinner->position = position;
3695 const char *newText = PIC(text);
3696 size_t newTextLen = strlen(newText);
3698 if ((newTextLen != strlen(textArea->text)) || memcmp(textArea->text, newText, newTextLen)) {
3699 textArea->text = newText;
3704 if (subText != NULL) {
3707 if (container->nbChildren != 3) {
3711 if (subTextArea->obj.type !=
TEXT_AREA) {
3714 const char *newSubText = PIC(subText);
3715 size_t newSubTextLen = strlen(newSubText);
3717 if ((newSubTextLen != strlen(subTextArea->text))
3718 || memcmp(subTextArea->text, newSubText, newSubTextLen)) {
3719 subTextArea->text = newSubText;
3738 if (layout == NULL) {
3742 "nbgl_layoutDraw(): container.nbChildren =%d, layout->nbChildren = %d\n",
3771 if (layout == NULL) {
3775 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