components/confirm_mnemonic: move title to center
#include "confirm_mnemonic.h"
-typedef struct {
- char title[100];
-} confirm_mnemonic_data_t;
-
/**
* Collects all component functions.
*/
@@ -43,26 +39,20 @@ component_t* confirm_mnemonic_create(
uint8_t index,
void (*check_word)(uint8_t))
{
- confirm_mnemonic_data_t* data = malloc(sizeof(confirm_mnemonic_data_t));
- if (!data) {
- Abort("Error: malloc confirm_mnemonic data");
- }
- memset(data, 0, sizeof(confirm_mnemonic_data_t));
-
component_t* confirm_mnemonic = malloc(sizeof(component_t));
if (!confirm_mnemonic) {
Abort("Error: malloc confirm_mnemonic");
}
memset(confirm_mnemonic, 0, sizeof(component_t));
confirm_mnemonic->f = &_component_functions;
- confirm_mnemonic->data = data;
confirm_mnemonic->dimension.width = SCREEN_WIDTH;
confirm_mnemonic->dimension.height = SCREEN_HEIGHT;
- snprintf(data->title, 100, "%02d:", index + 1);
+ char title[100];
+ snprintf(title, sizeof(title), "Confirm %02d", index + 1);
ui_util_add_sub_component(
- confirm_mnemonic, label_create(data->title, NULL, LEFT_TOP, confirm_mnemonic));
+ confirm_mnemonic, label_create(title, NULL, CENTER_TOP, confirm_mnemonic));
ui_util_add_sub_component(
confirm_mnemonic,
