1616
1717#include "bolos_target.h"
1818
19- #if defined(TARGET_STAX ) || defined(TARGET_FLEX )
19+ #if defined(TARGET_STAX ) || defined(TARGET_FLEX ) || defined( TARGET_APEX_P )
2020
2121#include "actions.h"
2222#include "app_mode.h"
@@ -40,6 +40,20 @@ zxerr_t account_enabled();
4040#define VERIFY_TITLE_LABEL_GENERIC "Verify operation"
4141#define INFO_LIST_SIZE 4
4242#define SETTING_CONTENTS_NB 1
43+
44+ // Define icon variables based on target platform
45+ #if defined(TARGET_STAX ) || defined(TARGET_FLEX )
46+ #define C_IMPORTANT_CIRCLE_ICON C_Important_Circle_64px
47+ #define C_WARNING_ICON C_Warning_64px
48+ #define C_REVIEW_ICON C_Review_64px
49+ #define C_ICON C_icon_stax_64
50+ #elif defined(TARGET_APEX_P )
51+ #define C_IMPORTANT_CIRCLE_ICON C_Important_Circle_24px
52+ #define C_WARNING_ICON C_Warning_24px
53+ #define C_REVIEW_ICON C_Review_48px
54+ #define C_ICON C_icon_apex_p_48
55+ #endif
56+
4357static const char HOME_TEXT [] =
4458 "This application enables\nsigning transactions on the\n" MENU_MAIN_APP_LINE1 " network" ;
4559
@@ -83,7 +97,7 @@ static void h_approve_internal(void) { h_approve(review_type); }
8397
8498#ifdef TARGET_STAX
8599#define MAX_INFO_LIST_ITEM_PER_PAGE 3
86- #else // TARGET_FLEX
100+ #else // TARGET_FLEX || TARGET_APEX_P
87101#define MAX_INFO_LIST_ITEM_PER_PAGE 2
88102#endif
89103
@@ -175,22 +189,21 @@ void view_custom_error_show(const char *upper, const char *lower) {
175189 MEMZERO (viewdata .value , MAX_CHARS_PER_VALUE1_LINE );
176190 snprintf (viewdata .key , MAX_CHARS_PER_KEY_LINE , "%s" , upper );
177191 snprintf (viewdata .value , MAX_CHARS_PER_VALUE1_LINE , "%s" , lower );
178-
179- nbgl_useCaseChoice (& C_Important_Circle_64px , viewdata .key , viewdata .value , "Ok" , "" , confirm_error );
192+ nbgl_useCaseChoice (& C_IMPORTANT_CIRCLE_ICON , viewdata .key , viewdata .value , "Ok" , "" , confirm_error );
180193}
181194
182195void view_blindsign_error_show () {
183- nbgl_useCaseChoice (& C_Warning_64px , "This transaction cannot\nbe clear-signed" ,
196+ nbgl_useCaseChoice (& C_WARNING_ICON , "This transaction cannot\nbe clear-signed" ,
184197 "Enable blind signing in the\nsettings to sign this\ntransaction." , "Go to settings" ,
185198 "Reject Transaction" , goto_settings );
186199}
187200
188201void view_error_show_impl () {
189- nbgl_useCaseChoice (& C_Important_Circle_64px , viewdata .key , viewdata .value , "Ok" , NULL , confirm_setting );
202+ nbgl_useCaseChoice (& C_IMPORTANT_CIRCLE_ICON , viewdata .key , viewdata .value , "Ok" , NULL , confirm_setting );
190203}
191204
192205void view_settings_show_impl () {
193- nbgl_useCaseHomeAndSettings (MENU_MAIN_APP_LINE1 , & C_icon_stax_64 , HOME_TEXT , 0 , & settingContents , & infoList , NULL ,
206+ nbgl_useCaseHomeAndSettings (MENU_MAIN_APP_LINE1 , & C_ICON , HOME_TEXT , 0 , & settingContents , & infoList , NULL ,
194207 app_quit );
195208}
196209
@@ -373,8 +386,8 @@ void view_idle_show_impl(__Z_UNUSED uint8_t item_idx, const char *statusString)
373386 infoList .infoContents = INFO_VALUES_PAGE ;
374387 infoList .infoTypes = INFO_KEYS_PAGE ;
375388
376- nbgl_useCaseHomeAndSettings (MENU_MAIN_APP_LINE1 , & C_icon_stax_64 , home_text , INIT_HOME_PAGE , & settingContents ,
377- & infoList , NULL , app_quit );
389+ nbgl_useCaseHomeAndSettings (MENU_MAIN_APP_LINE1 , & C_ICON , home_text , INIT_HOME_PAGE , & settingContents , & infoList ,
390+ NULL , app_quit );
378391}
379392
380393void view_message_impl (const char * title , const char * message ) {
@@ -402,7 +415,7 @@ static void review_configuration() {
402415 view_error_show ();
403416 }
404417
405- nbgl_useCaseChoice (& C_Important_Circle_64px , viewdata .key , viewdata .value , "Accept" , "Reject" , confirm_setting );
418+ nbgl_useCaseChoice (& C_IMPORTANT_CIRCLE_ICON , viewdata .key , viewdata .value , "Accept" , "Reject" , confirm_setting );
406419}
407420
408421static void config_useCaseAddressReview () {
@@ -440,7 +453,7 @@ static void config_useCaseAddressReview() {
440453#else
441454 intro_message = ADDRESS_TEXT ;
442455#endif
443- nbgl_useCaseAddressReview (viewdata .value , extraPagesPtr , & C_icon_stax_64 , intro_message , NULL , reviewAddressChoice );
456+ nbgl_useCaseAddressReview (viewdata .value , extraPagesPtr , & C_ICON , intro_message , NULL , reviewAddressChoice );
444457}
445458
446459static nbgl_layoutTagValue_t * update_item_callback (uint8_t index ) {
@@ -470,13 +483,12 @@ static void config_useCaseReview(nbgl_operationType_t type) {
470483 pairList .startIndex = 0 ;
471484
472485 if (app_mode_blindsign_required ()) {
473- nbgl_useCaseReviewBlindSigning (type , & pairList , & C_icon_stax_64 ,
486+ nbgl_useCaseReviewBlindSigning (type , & pairList , & C_ICON ,
474487 (intro_message == NULL ? "Review transaction" : intro_message ), intro_submessage ,
475488 "Accept risk and sign transaction ?" , NULL , reviewTransactionChoice );
476489 } else {
477- nbgl_useCaseReview (type , & pairList , & C_icon_stax_64 ,
478- (intro_message == NULL ? "Review transaction" : intro_message ), intro_submessage ,
479- (approval_label_buf [0 ] != '\0' ? approval_label_buf : APPROVE_LABEL_NBGL ),
490+ nbgl_useCaseReview (type , & pairList , & C_ICON , (intro_message == NULL ? "Review transaction" : intro_message ),
491+ intro_submessage , (approval_label_buf [0 ] != '\0' ? approval_label_buf : APPROVE_LABEL_NBGL ),
480492 reviewTransactionChoice );
481493 }
482494}
@@ -494,13 +506,14 @@ static void config_useCaseMessageReview() {
494506 pairList .callback = update_item_callback ;
495507 pairList .startIndex = 0 ;
496508 if (app_mode_blindsign_required ()) {
497- nbgl_useCaseReviewBlindSigning (TYPE_MESSAGE , & pairList , & C_Review_64px ,
509+ nbgl_useCaseReviewBlindSigning (TYPE_MESSAGE , & pairList , & C_REVIEW_ICON ,
498510 (intro_message == NULL ? "Review Message" : intro_message ), NULL ,
499511 "Accept risk and sign message ?" , NULL , reviewMessageChoice );
500512 } else {
501- nbgl_useCaseReview (
502- TYPE_MESSAGE , & pairList , & C_Review_64px , (intro_message == NULL ? "Review Message" : intro_message ), NULL ,
503- (approval_label_buf [0 ] != '\0' ? approval_label_buf : APPROVE_LABEL_NBGL_MSG ), reviewMessageChoice );
513+ nbgl_useCaseReview (TYPE_MESSAGE , & pairList , & C_REVIEW_ICON ,
514+ (intro_message == NULL ? "Review Message" : intro_message ), intro_submessage ,
515+ (approval_label_buf [0 ] != '\0' ? approval_label_buf : APPROVE_LABEL_NBGL_MSG ),
516+ reviewMessageChoice );
504517 }
505518}
506519
@@ -517,9 +530,8 @@ static void config_useCaseReviewLight(const char *title, const char *validate) {
517530 pairList .callback = update_item_callback ;
518531 pairList .startIndex = 0 ;
519532
520- nbgl_useCaseReviewLight (TYPE_OPERATION , & pairList , & C_icon_stax_64 ,
521- (title == NULL ? VERIFY_TITLE_LABEL_GENERIC : title ), NULL ,
522- (validate == NULL ? APPROVE_LABEL_NBGL_GENERIC : validate ), reviewGenericChoice );
533+ nbgl_useCaseReviewLight (TYPE_OPERATION , & pairList , & C_ICON , (title == NULL ? VERIFY_TITLE_LABEL_GENERIC : title ),
534+ NULL , (validate == NULL ? APPROVE_LABEL_NBGL_GENERIC : validate ), reviewGenericChoice );
523535}
524536
525537void view_review_show_impl (unsigned int requireReply , const char * title , const char * validate ) {
@@ -547,7 +559,7 @@ void view_review_show_impl(unsigned int requireReply, const char *title, const c
547559
548560 switch (review_type ) {
549561 case REVIEW_UI :
550- nbgl_useCaseReviewStart (& C_icon_stax_64 , "Review configuration" , NULL , CANCEL_LABEL , review_configuration ,
562+ nbgl_useCaseReviewStart (& C_ICON , "Review configuration" , NULL , CANCEL_LABEL , review_configuration ,
551563 h_reject_internal );
552564 break ;
553565 case REVIEW_ADDRESS : {
0 commit comments