Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new "content center" layout object to better match Figma #703

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading