From 91740ae4aa291e3f704adf68a77cd608d10c8868 Mon Sep 17 00:00:00 2001 From: grdddj Date: Thu, 13 Jul 2023 16:22:41 +0200 Subject: [PATCH] chore(core): change title of Shamir wallet creation [no changelog] --- core/embed/rust/src/ui/model_tt/component/frame.rs | 6 ++++-- core/src/apps/management/reset_device/__init__.py | 11 +++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/core/embed/rust/src/ui/model_tt/component/frame.rs b/core/embed/rust/src/ui/model_tt/component/frame.rs index cfe4b387f..c641f6efe 100644 --- a/core/embed/rust/src/ui/model_tt/component/frame.rs +++ b/core/embed/rust/src/ui/model_tt/component/frame.rs @@ -121,12 +121,14 @@ where const TITLE_SPACE: i16 = theme::BUTTON_SPACING; let bounds = bounds.inset(self.border); + // Allowing for little longer titles to fit in + const TITLE_EXTRA_SPACE: Insets = Insets::right(2); if let Some(b) = &mut self.button { let button_side = theme::CORNER_BUTTON_SIDE; let (header_area, button_area) = bounds.split_right(button_side); let (button_area, _) = button_area.split_top(button_side); b.place(button_area); - let title_area = self.title.place(header_area); + let title_area = self.title.place(header_area.outset(TITLE_EXTRA_SPACE)); let remaining = header_area.inset(Insets::top(title_area.height())); let subtitle_area = self.subtitle.place(remaining); @@ -141,7 +143,7 @@ where let content_area = bounds.inset(Insets::top(header_height + TITLE_SPACE)); self.content.place(content_area); } else { - let title_area = self.title.place(bounds); + let title_area = self.title.place(bounds.outset(TITLE_EXTRA_SPACE)); let remaining = bounds.inset(Insets::top(title_area.height())); let subtitle_area = self.subtitle.place(remaining); let remaining = remaining.inset(Insets::top(subtitle_area.height())); diff --git a/core/src/apps/management/reset_device/__init__.py b/core/src/apps/management/reset_device/__init__.py index 76ba00b5e..41d16738d 100644 --- a/core/src/apps/management/reset_device/__init__.py +++ b/core/src/apps/management/reset_device/__init__.py @@ -23,7 +23,7 @@ _DEFAULT_BACKUP_TYPE = BAK_T_BIP39 async def reset_device(msg: ResetDevice) -> Success: - from trezor import config, utils + from trezor import config from apps.common.request_pin import request_pin_confirm from trezor.ui.layouts import ( prompt_backup, @@ -39,14 +39,9 @@ async def reset_device(msg: ResetDevice) -> Success: # validate parameters and device state _validate_reset_device(msg) - # TR only has one-line title, TT can show more lines - delimiter = "\n" if utils.MODEL == "T" else " " - # make sure user knows they're setting up a new wallet - if backup_type == BAK_T_SLIP39_BASIC: - title = f"Create wallet{delimiter}(Shamir)" - elif backup_type == BAK_T_SLIP39_ADVANCED: - title = f"Create wallet{delimiter}(Super Shamir)" + if backup_type in (BAK_T_SLIP39_BASIC, BAK_T_SLIP39_ADVANCED): + title = "Create wallet (Shamir)" else: title = "Create wallet" await confirm_reset_device(title)