From 9ef1a286f1efcdef413b51083df8ecbee9307aee Mon Sep 17 00:00:00 2001 From: Lucas PASCAL Date: Mon, 11 Mar 2024 16:05:17 +0100 Subject: [PATCH] [clean] Flex migration first draft --- .github/PULL_REQUEST_TEMPLATE.md | 8 -------- Makefile | 8 ++++---- src/stax/mnemonic.c | 2 +- src/stax/mnemonic.h | 2 +- src/stax/passphrase_length_screen.c | 9 ++++----- src/stax/passphrase_length_screen.h | 2 +- src/stax/ui_stax.c | 1 + tests/functional/app.py | 8 ++++---- 8 files changed, 16 insertions(+), 24 deletions(-) delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 98b720fe..00000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,8 +0,0 @@ -# Checklist - -- [ ] App update process has been followed -- [ ] Target branch is `develop` -- [ ] Application version has been bumped - - diff --git a/Makefile b/Makefile index 28f598ff..d97aab5f 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ APP_LOAD_PARAMS = --appFlags 0x10 $(COMMON_LOAD_PARAMS) --curve secp256k1 --path ifeq ($(TARGET_NAME), TARGET_NANOS) ICONNAME=icons/nanos_app_recovery_check.gif -else ifeq ($(TARGET_NAME), TARGET_STAX) +else ifeq ($(TARGET_NAME), $(filter $(TARGET_NAME), TARGET_STAX TARGET_EUROPA)) ICONNAME=icons/stax_recovery_check_32px.gif else ICONNAME=icons/nanox_app_recovery_check.gif @@ -55,7 +55,7 @@ DEFINES += BOLOS_APP_ICON_SIZE_B=\(9+32\) DEFINES += IO_USB_MAX_ENDPOINTS=4 IO_HID_EP_LENGTH=64 DEFINES += HAVE_SPRINTF -ifneq ($(TARGET_NAME), TARGET_STAX) +ifneq ($(TARGET_NAME), $(filter $(TARGET_NAME), TARGET_STAX TARGET_EUROPA)) $(info Using BAGL) DEFINES += HAVE_BAGL HAVE_UX_FLOW else @@ -67,7 +67,7 @@ ifeq ($(TARGET_NAME), TARGET_NANOS) DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=128 else DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=300 - ifneq ($(TARGET_NAME), TARGET_STAX) + ifneq ($(TARGET_NAME), $(filter $(TARGET_NAME), TARGET_STAX TARGET_EUROPA)) DEFINES += HAVE_GLO096 DEFINES += BAGL_WIDTH=128 BAGL_HEIGHT=64 DEFINES += HAVE_BAGL_ELLIPSIS # long label truncation feature @@ -122,7 +122,7 @@ include $(BOLOS_SDK)/Makefile.glyphs APP_SOURCE_PATH += src ifneq ($(TARGET_NAME), TARGET_NANOS) - ifneq ($(TARGET_NAME), TARGET_STAX) + ifneq ($(TARGET_NAME), $(filter $(TARGET_NAME), TARGET_STAX TARGET_EUROPA)) SDK_SOURCE_PATH += lib_ux endif endif diff --git a/src/stax/mnemonic.c b/src/stax/mnemonic.c index 9257454d..2f51e52a 100644 --- a/src/stax/mnemonic.c +++ b/src/stax/mnemonic.c @@ -4,7 +4,7 @@ #include "../ux_common/common_bip39.h" #include "./mnemonic.h" -#if defined(TARGET_STAX) +#if defined(SCREEN_SIZE_WALLET) typedef struct buffer { // the mnemonic passphrase, built over time diff --git a/src/stax/mnemonic.h b/src/stax/mnemonic.h index 1bd981c5..79c5c3b4 100644 --- a/src/stax/mnemonic.h +++ b/src/stax/mnemonic.h @@ -19,7 +19,7 @@ #include #include "constants.h" -#if defined(TARGET_STAX) +#if defined(SCREEN_SIZE_WALLET) #define MAX_MNEMONIC_LENGTH (MNEMONIC_SIZE_24 * (MAX_WORD_LENGTH + 1)) diff --git a/src/stax/passphrase_length_screen.c b/src/stax/passphrase_length_screen.c index e2f23706..db9c5573 100644 --- a/src/stax/passphrase_length_screen.c +++ b/src/stax/passphrase_length_screen.c @@ -1,12 +1,11 @@ #include #include "glyphs.h" -#if defined(TARGET_STAX) +#if defined(SCREEN_SIZE_WALLET) #include #define UPPER_MARGIN 4 -#define BUTTON_DIAMETER 80 #define ICON_X 0 #define ICON_Y 148 @@ -27,7 +26,7 @@ nbgl_text_area_t *passphrase_length_set_title(nbgl_obj_t *align_to) { textArea->textColor = BLACK; textArea->text = "How long is your\nRecovery Phrase?"; textArea->textAlignment = CENTER; - textArea->fontId = BAGL_FONT_INTER_MEDIUM_32px; + textArea->fontId = LARGE_MEDIUM_FONT; textArea->obj.area.width = SCREEN_WIDTH - 2 * BORDER_MARGIN; textArea->obj.area.height = nbgl_getTextHeight(textArea->fontId, textArea->text); textArea->style = NO_STYLE; @@ -48,7 +47,7 @@ void passphrase_length_configure_buttons(nbgl_button_t **buttons, const size_t s button->obj.area.width = SCREEN_WIDTH - 2 * BORDER_MARGIN; button->obj.area.height = BUTTON_DIAMETER; button->radius = BUTTON_RADIUS; - button->fontId = BAGL_FONT_INTER_SEMIBOLD_24px; + button->fontId = SMALL_BOLD_1BPP_FONT; button->icon = NULL; button->localized = true; button->obj.alignmentMarginX = 0; @@ -68,7 +67,7 @@ nbgl_button_t *passphrase_length_set_back_button() { button->obj.area.height = BUTTON_DIAMETER; button->radius = BUTTON_RADIUS; button->text = NULL; - button->icon = &C_leftArrow32px; + button->icon = &LEFT_ARROW_ICON; button->obj.alignmentMarginX = 0; button->obj.alignmentMarginY = UPPER_MARGIN; button->obj.alignment = TOP_LEFT; diff --git a/src/stax/passphrase_length_screen.h b/src/stax/passphrase_length_screen.h index 69c3e897..218efdfe 100644 --- a/src/stax/passphrase_length_screen.h +++ b/src/stax/passphrase_length_screen.h @@ -1,6 +1,6 @@ #pragma once -#if defined(TARGET_STAX) +#if defined(SCREEN_SIZE_WALLET) nbgl_image_t *passphrase_length_set_icon(void); nbgl_text_area_t *passphrase_length_set_title(nbgl_obj_t *align_to); diff --git a/src/stax/ui_stax.c b/src/stax/ui_stax.c index 9b6f2fad..1eb6727f 100644 --- a/src/stax/ui_stax.c +++ b/src/stax/ui_stax.c @@ -7,6 +7,7 @@ #if defined(HAVE_NBGL) #include +#include #include #include #include diff --git a/tests/functional/app.py b/tests/functional/app.py index 47e363eb..d2cfc743 100644 --- a/tests/functional/app.py +++ b/tests/functional/app.py @@ -1,10 +1,10 @@ -from ragger.firmware.stax.layouts import CenteredFooter, _Layout, LetterOnlyKeyboard, \ +from ragger.firmware.nbgl.layouts import CenteredFooter, Element, LetterOnlyKeyboard, \ NavigationHeader, Suggestions -from ragger.firmware.stax.use_cases import UseCaseHomeExt, UseCaseSettings -from ragger.firmware.stax.screen import MetaScreen +from ragger.firmware.nbgl.use_cases import UseCaseHomeExt, UseCaseSettings +from ragger.firmware.nbgl.screen import MetaScreen -class CustomChoiceList(_Layout): +class CustomChoiceList(Element): def choose(self, index: int): assert 1 <= index <= 6, "Choice index must be in [1, 6]"