Skip to content

Commit

Permalink
Adapt NBGL layout for Europa onboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
nroggeman-ledger committed Feb 2, 2024
1 parent 7d84a9f commit 79f4b28
Show file tree
Hide file tree
Showing 7 changed files with 361 additions and 91 deletions.
3 changes: 3 additions & 0 deletions Makefile.defines
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ DEFINES += NBGL_USE_CASE
else
DEFINES += HAVE_BAGL
endif
ifeq ($(TARGET_NAME),TARGET_NANOS)
DEFINES += BAGL_HEIGHT=32
endif
ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_NANOS2))
ifndef USE_NBGL
DEFINES += HAVE_UX_FLOW
Expand Down
9 changes: 8 additions & 1 deletion lib_nbgl/include/nbgl_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ extern "C" {
#define NO_MORE_OBJ_ERROR -3
#define NBGL_NO_TUNE NB_TUNES

#ifdef HAVE_SE_TOUCH
#define NB_MAX_SUGGESTION_BUTTONS 4
#ifdef TARGET_STAX
#define NB_MAX_VISIBLE_SUGGESTION_BUTTONS NB_MAX_SUGGESTION_BUTTONS
#else // TARGET_STAX
#define NB_MAX_VISIBLE_SUGGESTION_BUTTONS 2
#endif // TARGET_STAX

#ifdef HAVE_SE_TOUCH
#define AVAILABLE_WIDTH (SCREEN_WIDTH - 2 * BORDER_MARGIN)
#else // HAVE_SE_TOUCH
// 7 pixels on each side
Expand Down Expand Up @@ -297,6 +302,8 @@ typedef struct {
const char *url; ///< URL for QR code
const char *text1; ///< first text (can be null)
const char *text2; ///< second text (can be null)
int16_t offsetY; ///< vertical shift to apply to this info (if > 0, shift to bottom)
bool centered; ///< if set to true, center vertically
bool largeText1; ///< if set to true, use 32px font for text1
} nbgl_layoutQRCode_t;

Expand Down
6 changes: 4 additions & 2 deletions lib_nbgl/include/nbgl_obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ extern "C" {

// external margin in pixels
#ifdef TARGET_STAX
#define BORDER_MARGIN 24
#define BORDER_MARGIN 24
#define BOTTOM_BORDER_MARGIN 24
#else // TARGET_STAX
#define BORDER_MARGIN 32
#define BORDER_MARGIN 32
#define BOTTOM_BORDER_MARGIN 24
#endif // TARGET_STAX

// Back button header height
Expand Down
Loading

0 comments on commit 79f4b28

Please sign in to comment.