1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-06-25 09:22:33 +00:00

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
This commit is contained in:
Lukas Bielesch 2025-03-18 18:23:10 +01:00 committed by obrusvit
parent 41997f6862
commit 44db238f08
6 changed files with 13 additions and 11 deletions

View File

@ -114,8 +114,8 @@ impl ValueKeypad {
const CANCEL_BUTTON_INDEX: usize = 2; const CANCEL_BUTTON_INDEX: usize = 2;
pub fn new_single_share() -> Self { pub fn new_single_share() -> Self {
const NUMBERS: [u32; 5] = [12, 24, 18, 20, 33]; const NUMBERS: [u32; 5] = [12, 20, 18, 24, 33];
const LABELS: [&str; 5] = ["12", "24", "18", "20", "33"]; const LABELS: [&str; 5] = ["12", "20", "18", "24", "33"];
Self::new(&LABELS, &NUMBERS) Self::new(&LABELS, &NUMBERS)
} }

View File

@ -41,7 +41,7 @@ impl NumberInputScreen {
Self { Self {
header: Header::new(TString::empty()), header: Header::new(TString::empty()),
action_bar: ActionBar::new_double( 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()), Button::with_text(TR::buttons__continue.into()),
), ),
number_input: NumberInput::new(min, max, init_value), 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>) { 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) { if let Some(text) = strutil::format_i64(self.value as i64, &mut buf) {
let font = fonts::FONT_SATOSHI_EXTRALIGHT_72; let font = fonts::FONT_SATOSHI_EXTRALIGHT_72;

View File

@ -58,7 +58,8 @@ impl<'a> ShareWordsScreen<'a> {
let header = Header::new(TR::reset__recovery_wallet_backup_title.into()); 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 { Self {
content, content,

View File

@ -99,7 +99,7 @@ pub fn new_prompt_backup() -> Result<SwipeFlow, error::Error> {
let content_skip_intro = TextScreen::new(paragraphs_skip_intro) let content_skip_intro = TextScreen::new(paragraphs_skip_intro)
.with_header( .with_header(
Header::new(TR::words__pay_attention.into()) Header::new(TR::words__important.into())
.with_icon(theme::ICON_WARNING, theme::ORANGE) .with_icon(theme::ICON_WARNING, theme::ORANGE)
.with_text_style(theme::label_title_danger()), .with_text_style(theme::label_title_danger()),
) )

View File

@ -473,7 +473,7 @@ impl FirmwareUI for UIEckhart {
) -> Result<impl LayoutMaybeTrace, Error> { ) -> Result<impl LayoutMaybeTrace, Error> {
let description = description.unwrap_or(TString::empty()); let description = description.unwrap_or(TString::empty());
let component = NumberInputScreen::new(min_count, max_count, count, description) 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); let layout = RootComponent::new(component);
@ -573,9 +573,10 @@ impl FirmwareUI for UIEckhart {
let layout = RootComponent::new( let layout = RootComponent::new(
TextScreen::new(checklist_content) TextScreen::new(checklist_content)
.with_header(Header::new(title).with_menu_button()) .with_header(Header::new(title))
.with_action_bar(ActionBar::new_single( .with_action_bar(ActionBar::new_double(
Button::with_text(button).styled(theme::button_default()), Button::with_icon(theme::ICON_CROSS).styled(theme::button_cancel()),
Button::with_text(button),
)), )),
); );

View File

@ -377,7 +377,7 @@ def show_share_confirmation_failure() -> Awaitable[None]:
return show_reset_warning( return show_reset_warning(
"warning_backup_check", "warning_backup_check",
TR.reset__incorrect_word_selected, TR.reset__incorrect_word_selected,
TR.words__pay_attention, TR.words__important,
TR.words__try_again, TR.words__try_again,
ButtonRequestType.ResetDevice, ButtonRequestType.ResetDevice,
) )