Skip to content

Commit

Permalink
FWEO-1192 - New UI for Stax
Browse files Browse the repository at this point in the history
  • Loading branch information
nroggeman-ledger committed Jun 13, 2024
1 parent 8cfa715 commit 7bc4441
Show file tree
Hide file tree
Showing 22 changed files with 381 additions and 878 deletions.
21 changes: 0 additions & 21 deletions lib_nbgl/doc/nbgl_layout.dox
Original file line number Diff line number Diff line change
Expand Up @@ -314,27 +314,6 @@ The API to insert such an object is @ref nbgl_layoutAddSpinner().

\warning No other object shall be inserted beside this one.

@subsection progress_indicator Progress indicator

\image{inline} html layout5.png "caption" height=300

This object, drawned in top of the screen, is essentially made of a discrete page progress bar (slashes or digits).
An optional "back" button, symbolized with a left arrow, can also be drawned on the left of the page progress.

The parameters to build this object are:

- The total number of pages
- The current page (from 0 to (total_nb_pages-1))
- A boolean to indicate whether to use a "back" button or not
- A \b token used with the action callback when the "back" button is touched

Digits are represented instead of slashes if the number of pages exceeds 10. In this case, instead of marking the active page
as a slash in @ref BLACK, the page indicator will indicate *"<current_page> of <total_nb_pages>"*

The API to insert such an object is @ref nbgl_layoutAddProgressIndicator().

\warning This object is incompatible with top-right button and page selector.

@subsection qr_code QR Code

\image{inline} html stax_layout13.png "caption" height=300
Expand Down
Binary file added lib_nbgl/glyphs/32px/radio_active_32px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib_nbgl/glyphs/32px/radio_inactive_32px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib_nbgl/glyphs/40px/radio_active_40px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib_nbgl/glyphs/40px/radio_inactive_40px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lib_nbgl/glyphs/wallet/radio_active_32px.bmp
Binary file not shown.
Binary file removed lib_nbgl/glyphs/wallet/radio_active_40.bmp
Binary file not shown.
Binary file removed lib_nbgl/glyphs/wallet/radio_inactive_32px.bmp
Binary file not shown.
Binary file removed lib_nbgl/glyphs/wallet/radio_inactive_40.bmp
Binary file not shown.
52 changes: 15 additions & 37 deletions lib_nbgl/include/nbgl_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ extern "C" {
#define EXIT_PAGE 0xFF

#ifdef TARGET_STAX
#define NB_MAX_SUGGESTION_BUTTONS 4
#define NB_MAX_VISIBLE_SUGGESTION_BUTTONS NB_MAX_SUGGESTION_BUTTONS
#define NB_MAX_SUGGESTION_BUTTONS 12
// only 4 buttons are visible at the same time on Stax
#define NB_MAX_VISIBLE_SUGGESTION_BUTTONS 4
#define TOUCHABLE_HEADER_BAR_HEIGHT 88
#define TOUCHABLE_MAIN_BAR_HEIGHT 88
#define TOUCHABLE_BAR_HEIGHT 88
#define TOUCHABLE_DETAILLED_BAR_HEIGHT 88
#define SIMPLE_FOOTER_HEIGHT 128
#define SMALL_CENTERING_HEADER 24
#define TOUCHABLE_MAIN_BAR_HEIGHT 96
#define TOUCHABLE_BAR_HEIGHT 96
#define SMALL_FOOTER_HEIGHT 88
#define SIMPLE_FOOTER_HEIGHT 92
#define SMALL_CENTERING_HEADER 32
#define MEDIUM_CENTERING_HEADER 56
#define LONG_PRESS_BUTTON_HEIGHT 128
#else // TARGET_STAX
#define NB_MAX_SUGGESTION_BUTTONS 6
Expand All @@ -54,9 +56,10 @@ extern "C" {
#define TOUCHABLE_HEADER_BAR_HEIGHT 96
#define TOUCHABLE_MAIN_BAR_HEIGHT 100
#define TOUCHABLE_BAR_HEIGHT 92
#define TOUCHABLE_DETAILLED_BAR_HEIGHT 140
#define SMALL_FOOTER_HEIGHT 96
#define SIMPLE_FOOTER_HEIGHT 96
#define SMALL_CENTERING_HEADER 40
#define MEDIUM_CENTERING_HEADER 64
#define LONG_PRESS_BUTTON_HEIGHT 152
#endif // TARGET_STAX

Expand Down Expand Up @@ -389,10 +392,9 @@ typedef struct {
typedef enum {
HEADER_EMPTY = 0, ///< empty space, to have a better vertical centering of centered info
HEADER_BACK_AND_TEXT, ///< back key and optional text
HEADER_BACK_AND_PROGRESS, ///< optional back key and progress indicator (only on Stax)
HEADER_TITLE, ///< simple centered text
HEADER_EXTENDED_BACK, ///< back key, centered text and touchable key on the right
HEADER_RIGHT_TEXT, ///< touchable text on the right, with a vertical separation line
HEADER_TITLE, ///< simple centered text
HEADER_EXTENDED_BACK, ///< back key, centered text and touchable key on the right
HEADER_RIGHT_TEXT, ///< touchable text on the right, with a vertical separation line
NB_HEADER_TYPES
} nbgl_layoutHeaderType_t;

Expand All @@ -412,15 +414,6 @@ typedef struct {
uint8_t token; ///< when back key is pressed
tune_index_e tuneId; ///< when back key is pressed
} backAndText; ///< if type is @ref HEADER_BACK_AND_TEXT
struct {
const nbgl_icon_details_t *actionIcon; ///< right button icon
uint8_t activePage;
uint8_t nbPages;
bool withBack;
uint8_t token; ///< when optional back key is pressed
uint8_t actionToken; ///< when optional right button is pressed
tune_index_e tuneId; ///< when optional back key is pressed
} progressAndBack; ///< if type is @ref HEADER_BACK_AND_PROGRESS
struct {
const char *text;
} title; ///< if type is @ref HEADER_TITLE
Expand Down Expand Up @@ -469,6 +462,7 @@ typedef struct {
} emptySpace; ///< if type is @ref FOOTER_EMPTY
struct {
const char *text;
bool mutedOut; ///< if true, text is displayed in gray
uint8_t token;
tune_index_e tuneId;
} simpleText; ///< if type is @ref FOOTER_SIMPLE_TEXT
Expand Down Expand Up @@ -574,12 +568,6 @@ int nbgl_layoutAddBottomButton(nbgl_layout_t *layout,
uint8_t token,
bool separationLine,
tune_index_e tuneId);
int nbgl_layoutAddProgressIndicator(nbgl_layout_t *layout,
uint8_t activePage,
uint8_t nbPages,
bool withBack,
uint8_t backToken,
tune_index_e tuneId);
int nbgl_layoutAddSpinner(nbgl_layout_t *layout, const char *text, bool fixed);
int nbgl_layoutAddSwipe(nbgl_layout_t *layout,
uint16_t swipesMask,
Expand All @@ -605,16 +593,6 @@ int nbgl_layoutUpdateKeyboard(nbgl_layout_t *layout,
bool updateCasing,
keyboardCase_t casing);
bool nbgl_layoutKeyboardNeedsRefresh(nbgl_layout_t *layout, uint8_t index);
DEPRECATED int nbgl_layoutAddSuggestionButtons(nbgl_layout_t *layout,
uint8_t nbUsedButtons,
const char *buttonTexts[NB_MAX_SUGGESTION_BUTTONS],
int firstButtonToken,
tune_index_e tuneId);
DEPRECATED int nbgl_layoutUpdateSuggestionButtons(
nbgl_layout_t *layout,
uint8_t index,
uint8_t nbUsedButtons,
const char *buttonTexts[NB_MAX_SUGGESTION_BUTTONS]);
DEPRECATED int nbgl_layoutAddEnteredText(nbgl_layout_t *layout,
bool numbered,
uint8_t number,
Expand Down
8 changes: 6 additions & 2 deletions lib_nbgl/include/nbgl_obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ extern "C" {
#define PUSH_ICON C_Chevron_32px
#define LEFT_ARROW_ICON C_Back_32px
#define RIGHT_ARROW_ICON C_Next_32px
#define CHEVRON_BACK_ICON C_Chevron_Back_32px
#define CHEVRON_NEXT_ICON C_Chevron_Next_32px
#define CLOSE_ICON C_Close_32px
#define WHEEL_ICON C_Settings_32px
#define INFO_I_ICON C_Info_32px
Expand All @@ -131,11 +133,13 @@ extern "C" {
#define SHIFT_ICON C_Maj_40px
#define SHIFT_LOCKED_ICON C_Maj_Lock_40px
#define VALIDATE_ICON C_Check_40px
#define RADIO_OFF_ICON C_radio_inactive_40
#define RADIO_ON_ICON C_radio_active_40
#define RADIO_OFF_ICON C_radio_inactive_40px
#define RADIO_ON_ICON C_radio_active_40px
#define PUSH_ICON C_Chevron_40px
#define LEFT_ARROW_ICON C_Back_40px
#define RIGHT_ARROW_ICON C_Next_40px
#define CHEVRON_BACK_ICON C_Chevron_Back_40px
#define CHEVRON_NEXT_ICON C_Chevron_Next_40px
#define CLOSE_ICON C_Close_40px
#define WHEEL_ICON C_Settings_40px
#define INFO_I_ICON C_Info_40px
Expand Down
38 changes: 8 additions & 30 deletions lib_nbgl/include/nbgl_page.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,6 @@ typedef struct nbgl_pageContent_s {
*/
typedef void *nbgl_page_t;

/**
* @brief The different types of navigation in a multi-screens page
*
*/
typedef enum {
NAV_WITH_TAP, ///< move forward with "tap" and possibly backward with top left arrow
NAV_WITH_BUTTONS, ///< move forward and backward with buttons in bottom nav bar
} nbgl_pageNavigationType_t;

/**
* @brief Structure containing all information to create a navigation with "tap"
*
Expand All @@ -104,21 +95,6 @@ typedef struct nbgl_pageNavWithTap_s {
const char *quitText; ///< the text displayed in footer, used to quit
} nbgl_pageNavWithTap_t;

/**
* @brief Structure containing all information to create a navigation with buttons in bottom nav bar
*
*/
typedef struct nbgl_pageNavWithButtons_s {
bool quitButton; ///< if set to true, a quit button (X) is displayed in the nav bar
bool backButton; ///< if set to true, a back button (<-) is displayed in the nav bar
bool
visiblePageIndicator; ///< if set to true, the page indicator will be visible in navigation
uint8_t navToken; ///< the token used as argument of the actionCallback when the nav buttons
///< are pressed (index param gives the page)
const char
*quitText; ///< the text displayed in footer (on the left), used to quit (only on Flex)
} nbgl_pageNavWithButtons_t;

/**
* @brief Structure containing all specific information when creating a multi-screens page.
*
Expand All @@ -128,18 +104,20 @@ typedef struct nbgl_pageMultiScreensDescription_s {
uint8_t nbPages; ///< the number of pages to display (if <2, no navigation bar)
uint8_t
quitToken; ///< the token used as argument of the actionCallback when the footer is touched
nbgl_pageNavigationType_t navType; ///< type of navigation, it will tell which structure in the
///< following union will be used
bool progressIndicator; ///< if set to true, display a progress indicator on top of the page
tune_index_e
tuneId; ///< if not @ref NBGL_NO_TUNE, a tune will be played when next or back is pressed
const char *skipText; ///< if not NULL the text displayed in right part of footer, used for
///< example to skip pages
uint8_t skipToken; ///< if skipText is NULL the token used when right part of footer is touched
union {
nbgl_pageNavWithTap_t navWithTap; ///< structure used when navigation with "tap"
nbgl_pageNavWithButtons_t navWithButtons; ///< structure used when navigation with buttons
};
bool quitButton; ///< if set to true, a quit button (X) is displayed in the nav bar
bool backButton; ///< if set to true, a back button (<-) is displayed in the nav bar
bool
visiblePageIndicator; ///< if set to true, the page indicator will be visible in navigation
uint8_t navToken; ///< the token used as argument of the actionCallback when the nav buttons
///< are pressed (index param gives the page)
const char
*quitText; ///< the text displayed in footer (on the left), used to quit (only on Flex)
} nbgl_pageNavigationInfo_t;

/**
Expand Down
2 changes: 1 addition & 1 deletion lib_nbgl/include/nbgl_use_case.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ extern "C" {
/**
* @brief height available for tag/value pairs display
*/
#define TAG_VALUE_AREA_HEIGHT 400
#define TAG_VALUE_AREA_HEIGHT (SCREEN_HEIGHT - SMALL_CENTERING_HEADER - SIMPLE_FOOTER_HEIGHT)

/**
* @brief Default strings used in the Home tagline
Expand Down
Loading

0 comments on commit 7bc4441

Please sign in to comment.