Skip to content

Commit

Permalink
Add nbgl_useCaseHomeExtIcon
Browse files Browse the repository at this point in the history
  • Loading branch information
cedelavergne-ledger committed Feb 26, 2024
1 parent 54de60d commit 3f3aae1
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 9 deletions.
9 changes: 9 additions & 0 deletions lib_nbgl/include/nbgl_use_case.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ void nbgl_useCaseHomeExt(const char *appName,
nbgl_callback_t actionCallback,
nbgl_callback_t topRightCallback,
nbgl_callback_t quitCallback);
void nbgl_useCaseHomeExtIcon(const char *appName,
const nbgl_icon_details_t *appIcon,
const char *tagline,
bool withSettings,
const char *actionButtonText,
nbgl_callback_t actionCallback,
nbgl_callback_t topRightCallback,
nbgl_callback_t quitCallback,
const nbgl_icon_details_t *icon);
void nbgl_useCasePlugInHome(const char *plugInName,
const char *appName,
const nbgl_icon_details_t *appIcon,
Expand Down
58 changes: 49 additions & 9 deletions lib_nbgl/src/nbgl_use_case.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,15 +940,17 @@ void nbgl_useCaseHome(const char *appName,
* NULL)
* @param topRightCallback callback called when top-right button is touched
* @param quitCallback callback called when quit button is touched
* @param icon buffer containing the 1BPP icon for action button
*/
void nbgl_useCaseHomeExt(const char *appName,
const nbgl_icon_details_t *appIcon,
const char *tagline,
bool withSettings,
const char *actionButtonText,
nbgl_callback_t actionCallback,
nbgl_callback_t topRightCallback,
nbgl_callback_t quitCallback)
void nbgl_useCaseHomeExtIcon(const char *appName,
const nbgl_icon_details_t *appIcon,
const char *tagline,
bool withSettings,
const char *actionButtonText,
nbgl_callback_t actionCallback,
nbgl_callback_t topRightCallback,
nbgl_callback_t quitCallback,
const nbgl_icon_details_t *icon)
{
reset_callbacks();

Expand Down Expand Up @@ -1011,10 +1013,48 @@ void nbgl_useCaseHomeExt(const char *appName,
if (actionButtonText != NULL) {
info.centeredInfo.offsetY -= 40;
}
pageContext = nbgl_pageDrawInfo(&pageCallback, NULL, &info);
pageContext = nbgl_pageDrawInfoIcon(&pageCallback, NULL, &info, icon);
nbgl_refreshSpecial(FULL_COLOR_CLEAN_REFRESH);
}

/**
* @brief draws the extended version of home page of an app (page on which we land when launching it
* from dashboard)
* @note it enables to use an action button (black)
*
* @param appName app name
* @param appIcon app icon
* @param tagline text under app name (if NULL, it will be "This app enables signing transactions on
* the <appName> network.")
* @param withSettings if true, use a "settings" (wheel) icon in bottom button, otherwise a "info"
* (i)
* @param actionButtonText if not NULL, text used for an action button (in black, on top of "Quit
* App" button)
* @param actionCallback callback called when action button is touched (if actionButtonText is not
* NULL)
* @param topRightCallback callback called when top-right button is touched
* @param quitCallback callback called when quit button is touched
*/
void nbgl_useCaseHomeExt(const char *appName,
const nbgl_icon_details_t *appIcon,
const char *tagline,
bool withSettings,
const char *actionButtonText,
nbgl_callback_t actionCallback,
nbgl_callback_t topRightCallback,
nbgl_callback_t quitCallback)
{
nbgl_useCaseHomeExtIcon(appName,
appIcon,
tagline,
withSettings,
actionButtonText,
actionCallback,
topRightCallback,
quitCallback,
NULL);
}

/**
* @brief draws the home page of a plug-in app (page on which we land when launching it from
* dashboard)
Expand Down

0 comments on commit 3f3aae1

Please sign in to comment.