@@ -3022,19 +3022,20 @@ uint8_t nbgl_useCaseGetNbSwitchesInPage(uint8_t nbSwit
3022
3022
nbgl_contentSwitch_t * switchArray = (nbgl_contentSwitch_t * ) PIC (switchesList -> switches );
3023
3023
3024
3024
while (nbSwitchesInPage < nbSwitches ) {
3025
- // The text string must be a 1 liner and its height is LIST_ITEM_MIN_TEXT_HEIGHT
3026
- currentHeight += LIST_ITEM_MIN_TEXT_HEIGHT + LIST_ITEM_PRE_HEADING ;
3027
-
3028
- if (switchArray [startIndex + nbSwitchesInPage ].subText ) {
3025
+ nbgl_contentSwitch_t * curSwitch = & switchArray [startIndex + nbSwitchesInPage ];
3026
+ // The text string is either a 1 liner and its height is LIST_ITEM_MIN_TEXT_HEIGHT
3027
+ // or we use its height directly
3028
+ uint16_t textHeight = MAX (
3029
+ LIST_ITEM_MIN_TEXT_HEIGHT ,
3030
+ nbgl_getTextHeightInWidth (SMALL_BOLD_FONT , curSwitch -> text , AVAILABLE_WIDTH , true));
3031
+ currentHeight += textHeight + 2 * LIST_ITEM_PRE_HEADING ;
3032
+
3033
+ if (curSwitch -> subText ) {
3029
3034
currentHeight += LIST_ITEM_HEADING_SUB_TEXT ;
3030
3035
3031
3036
// sub-text height
3032
- currentHeight
3033
- += nbgl_getTextHeightInWidth (SMALL_REGULAR_FONT ,
3034
- switchArray [startIndex + nbSwitchesInPage ].subText ,
3035
- AVAILABLE_WIDTH ,
3036
- true);
3037
- currentHeight += LIST_ITEM_PRE_HEADING ; // under the sub-text
3037
+ currentHeight += nbgl_getTextHeightInWidth (
3038
+ SMALL_REGULAR_FONT , curSwitch -> subText , AVAILABLE_WIDTH , true);
3038
3039
}
3039
3040
// if height is over the limit
3040
3041
if (currentHeight >= (INFOS_AREA_HEIGHT - navHeight )) {
@@ -3901,9 +3902,10 @@ void nbgl_useCaseAdvancedReview(nbgl_operationType_t operationType,
3901
3902
reviewWithWarnCtx .choiceCallback = choiceCallback ;
3902
3903
3903
3904
// display the initial warning only of a risk/threat or blind signing
3904
- if (!(reviewWithWarnCtx .warning -> predefinedSet & (1 << W3C_THREAT_DETECTED_WARN ))
3905
- && !(reviewWithWarnCtx .warning -> predefinedSet & (1 << W3C_RISK_DETECTED_WARN ))
3906
- && !(reviewWithWarnCtx .warning -> predefinedSet & (1 << BLIND_SIGNING_WARN ))) {
3905
+ if ((!(reviewWithWarnCtx .warning -> predefinedSet & (1 << W3C_THREAT_DETECTED_WARN ))
3906
+ && !(reviewWithWarnCtx .warning -> predefinedSet & (1 << W3C_RISK_DETECTED_WARN ))
3907
+ && !(reviewWithWarnCtx .warning -> predefinedSet & (1 << BLIND_SIGNING_WARN )))
3908
+ && (warning -> introDetails == NULL )) {
3907
3909
useCaseReview (operationType ,
3908
3910
tagValueList ,
3909
3911
icon ,
0 commit comments