Skip to content

Commit

Permalink
Add a new "content center" layout object to better match Figma
Browse files Browse the repository at this point in the history
  • Loading branch information
nroggeman-ledger committed Jun 21, 2024
1 parent be09f0e commit b18416c
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 146 deletions.
20 changes: 20 additions & 0 deletions lib_nbgl/include/nbgl_content.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,26 @@ typedef struct {
#endif // HAVE_SE_TOUCH
} nbgl_contentCenteredInfo_t;

/**
* @brief This structure contains info to build a centered (vertically and horizontally) area, with
* many fields (if NULL, not used):
* - an icon (with a possible hug)
* - a title in black large case
* - a sub-title in black small bold case
* - a description in black small regular case
* - a sub-text in dark gray regular small case
* - a padding on the bottom
*/
typedef struct {
const nbgl_icon_details_t *icon; ///< the icon (can be null)
const char *title; ///< title in black large (can be null)
const char *smallTitle; ///< sub-title in black small bold case (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 iconHug; ///< vertical margin to apply on top and bottom of the icon
bool padding; ///< if true, apply a padding of 40px at the bottom
} nbgl_contentCenter_t;

/**
* @brief This structure contains data to build a centered info + long press button content
*/
Expand Down
1 change: 1 addition & 0 deletions lib_nbgl/include/nbgl_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ typedef struct {
**********************/
nbgl_layout_t *nbgl_layoutGet(const nbgl_layoutDescription_t *description);
int nbgl_layoutAddCenteredInfo(nbgl_layout_t *layout, const nbgl_layoutCenteredInfo_t *info);
int nbgl_layoutAddContentCenter(nbgl_layout_t *layout, const nbgl_contentCenter_t *info);
int nbgl_layoutAddProgressBar(nbgl_layout_t *layout, const nbgl_layoutProgressBar_t *barLayout);

#ifdef HAVE_SE_TOUCH
Expand Down
Loading

0 comments on commit b18416c

Please sign in to comment.