From 30b686b8bb8a7d3802412351619cd6922058d0ba Mon Sep 17 00:00:00 2001 From: Lukas Bielesch Date: Tue, 18 Mar 2025 18:23:10 +0100 Subject: [PATCH] fix(eckhart): minor fixes for recovery and reset screens correct placement of numbers on the keypad, fix number input screen for double-digit numbers, remove unused menu button, use double action bar instead, fix inconsistent hint use update warning titles --- .../firmware/keyboard/word_count_screen.rs | 4 ++-- .../ui/layout_eckhart/firmware/number_input_screen.rs | 4 ++-- .../rust/src/ui/layout_eckhart/firmware/share_words.rs | 3 ++- .../rust/src/ui/layout_eckhart/flow/prompt_backup.rs | 2 +- core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs | 9 +++++---- core/src/trezor/ui/layouts/eckhart/reset.py | 2 +- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/core/embed/rust/src/ui/layout_eckhart/firmware/keyboard/word_count_screen.rs b/core/embed/rust/src/ui/layout_eckhart/firmware/keyboard/word_count_screen.rs index 7ac82d76c7..093dc82b69 100644 --- a/core/embed/rust/src/ui/layout_eckhart/firmware/keyboard/word_count_screen.rs +++ b/core/embed/rust/src/ui/layout_eckhart/firmware/keyboard/word_count_screen.rs @@ -114,8 +114,8 @@ impl ValueKeypad { const CANCEL_BUTTON_INDEX: usize = 2; pub fn new_single_share() -> Self { - const NUMBERS: [u32; 5] = [12, 24, 18, 20, 33]; - const LABELS: [&str; 5] = ["12", "24", "18", "20", "33"]; + const NUMBERS: [u32; 5] = [12, 20, 18, 24, 33]; + const LABELS: [&str; 5] = ["12", "20", "18", "24", "33"]; Self::new(&LABELS, &NUMBERS) } diff --git a/core/embed/rust/src/ui/layout_eckhart/firmware/number_input_screen.rs b/core/embed/rust/src/ui/layout_eckhart/firmware/number_input_screen.rs index 839a1a598c..c2828e879a 100644 --- a/core/embed/rust/src/ui/layout_eckhart/firmware/number_input_screen.rs +++ b/core/embed/rust/src/ui/layout_eckhart/firmware/number_input_screen.rs @@ -41,7 +41,7 @@ impl NumberInputScreen { Self { header: Header::new(TString::empty()), action_bar: ActionBar::new_double( - Button::with_icon(theme::ICON_CHEVRON_UP), + Button::with_icon(theme::ICON_CROSS).styled(theme::button_cancel()), Button::with_text(TR::buttons__continue.into()), ), number_input: NumberInput::new(min, max, init_value), @@ -190,7 +190,7 @@ impl NumberInput { } fn render_number<'s>(&'s self, target: &mut impl Renderer<'s>) { - let mut buf = [0u8; 1]; + let mut buf = [0u8; 3]; if let Some(text) = strutil::format_i64(self.value as i64, &mut buf) { let font = fonts::FONT_SATOSHI_EXTRALIGHT_72; diff --git a/core/embed/rust/src/ui/layout_eckhart/firmware/share_words.rs b/core/embed/rust/src/ui/layout_eckhart/firmware/share_words.rs index 4434bfa7f7..a29776becd 100644 --- a/core/embed/rust/src/ui/layout_eckhart/firmware/share_words.rs +++ b/core/embed/rust/src/ui/layout_eckhart/firmware/share_words.rs @@ -58,7 +58,8 @@ impl<'a> ShareWordsScreen<'a> { let header = Header::new(TR::reset__recovery_wallet_backup_title.into()); - let hint = Hint::new_instruction(TR::reset__share_words_first, Some(theme::ICON_INFO)); + let mut hint = Hint::new_page_counter(); + hint.update(content.pager()); Self { content, diff --git a/core/embed/rust/src/ui/layout_eckhart/flow/prompt_backup.rs b/core/embed/rust/src/ui/layout_eckhart/flow/prompt_backup.rs index 6cceaa1de0..c5eead088d 100644 --- a/core/embed/rust/src/ui/layout_eckhart/flow/prompt_backup.rs +++ b/core/embed/rust/src/ui/layout_eckhart/flow/prompt_backup.rs @@ -99,7 +99,7 @@ pub fn new_prompt_backup() -> Result { let content_skip_intro = TextScreen::new(paragraphs_skip_intro) .with_header( - Header::new(TR::words__pay_attention.into()) + Header::new(TR::words__important.into()) .with_icon(theme::ICON_WARNING, theme::ORANGE) .with_text_style(theme::label_title_danger()), ) diff --git a/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs b/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs index 6f873431e8..3483ea2c18 100644 --- a/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs +++ b/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs @@ -473,7 +473,7 @@ impl FirmwareUI for UIEckhart { ) -> Result { let description = description.unwrap_or(TString::empty()); let component = NumberInputScreen::new(min_count, max_count, count, description) - .with_header(Header::new(title).with_menu_button()); + .with_header(Header::new(title)); let layout = RootComponent::new(component); @@ -573,9 +573,10 @@ impl FirmwareUI for UIEckhart { let layout = RootComponent::new( TextScreen::new(checklist_content) - .with_header(Header::new(title).with_menu_button()) - .with_action_bar(ActionBar::new_single( - Button::with_text(button).styled(theme::button_default()), + .with_header(Header::new(title)) + .with_action_bar(ActionBar::new_double( + Button::with_icon(theme::ICON_CROSS).styled(theme::button_cancel()), + Button::with_text(button), )), ); diff --git a/core/src/trezor/ui/layouts/eckhart/reset.py b/core/src/trezor/ui/layouts/eckhart/reset.py index eed9eee6f0..c16c21ce52 100644 --- a/core/src/trezor/ui/layouts/eckhart/reset.py +++ b/core/src/trezor/ui/layouts/eckhart/reset.py @@ -377,7 +377,7 @@ def show_share_confirmation_failure() -> Awaitable[None]: return show_reset_warning( "warning_backup_check", TR.reset__incorrect_word_selected, - TR.words__pay_attention, + TR.words__important, TR.words__try_again, ButtonRequestType.ResetDevice, )