@@ -1212,20 +1212,16 @@ int nbgl_layoutAddText(nbgl_layout_t *layout, const char *text, const char *subT
1212
1212
if (text != NULL ) {
1213
1213
textArea = (nbgl_text_area_t * ) nbgl_objPoolGet (TEXT_AREA , layoutInt -> layer );
1214
1214
1215
- textArea -> textColor = BLACK ;
1216
- textArea -> text = PIC (text );
1217
- textArea -> textAlignment = MID_LEFT ;
1218
- textArea -> fontId = SMALL_BOLD_FONT ;
1219
- textArea -> style = NO_STYLE ;
1220
- textArea -> wrapping = true;
1221
- textArea -> obj .alignment = NO_ALIGNMENT ;
1222
- #ifdef TARGET_STAX
1223
- textArea -> obj .alignmentMarginY = 32 ;
1224
- #else // TARGET_STAX
1225
- textArea -> obj .alignmentMarginY = 28 ;
1226
- #endif // TARGET_STAX
1227
- textArea -> obj .area .width = container -> obj .area .width ;
1228
- textArea -> obj .area .height = nbgl_getTextHeightInWidth (
1215
+ textArea -> textColor = BLACK ;
1216
+ textArea -> text = PIC (text );
1217
+ textArea -> textAlignment = MID_LEFT ;
1218
+ textArea -> fontId = SMALL_BOLD_FONT ;
1219
+ textArea -> style = NO_STYLE ;
1220
+ textArea -> wrapping = true;
1221
+ textArea -> obj .alignment = NO_ALIGNMENT ;
1222
+ textArea -> obj .alignmentMarginY = PRE_TEXT_MARGIN ;
1223
+ textArea -> obj .area .width = container -> obj .area .width ;
1224
+ textArea -> obj .area .height = nbgl_getTextHeightInWidth (
1229
1225
textArea -> fontId , textArea -> text , textArea -> obj .area .width , textArea -> wrapping );
1230
1226
fullHeight += textArea -> obj .area .height + textArea -> obj .alignmentMarginY ;
1231
1227
container -> children [container -> nbChildren ] = (nbgl_obj_t * ) textArea ;
@@ -1246,13 +1242,8 @@ int nbgl_layoutAddText(nbgl_layout_t *layout, const char *text, const char *subT
1246
1242
subTextArea -> textAlignment = MID_LEFT ;
1247
1243
subTextArea -> obj .alignment = NO_ALIGNMENT ;
1248
1244
if (text != NULL ) {
1249
- #ifdef TARGET_STAX
1250
- subTextArea -> obj .alignmentMarginY = 16 ;
1251
- fullHeight += 28 ; // under the subText
1252
- #else // TARGET_STAX
1253
- subTextArea -> obj .alignmentMarginY = 14 ;
1254
- fullHeight += 26 ; // under the subText
1255
- #endif // TARGET_STAX
1245
+ subTextArea -> obj .alignmentMarginY = TEXT_SUBTEXT_MARGIN ;
1246
+ fullHeight += POST_SUBTEXT_MARGIN ; // under the subText
1256
1247
}
1257
1248
else {
1258
1249
#ifdef TARGET_STAX
@@ -1268,11 +1259,7 @@ int nbgl_layoutAddText(nbgl_layout_t *layout, const char *text, const char *subT
1268
1259
fullHeight += subTextArea -> obj .area .height + subTextArea -> obj .alignmentMarginY ;
1269
1260
}
1270
1261
else {
1271
- #ifdef TARGET_STAX
1272
- fullHeight += 32 ;
1273
- #else // TARGET_STAX
1274
- fullHeight += 28 ;
1275
- #endif // TARGET_STAX
1262
+ fullHeight += PRE_TEXT_MARGIN ;
1276
1263
}
1277
1264
container -> obj .area .height = fullHeight ;
1278
1265
container -> layout = VERTICAL ;
0 commit comments