1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-05-21 08:18:46 +00:00

chore(eckhart): implement show success delay

This commit is contained in:
Lukas Bielesch 2025-03-26 09:26:37 +01:00 committed by obrusvit
parent 67e1417501
commit 266360e3fa
2 changed files with 5 additions and 1 deletions

View File

@ -832,7 +832,7 @@ impl FirmwareUI for UIEckhart {
button: TString<'static>, button: TString<'static>,
description: TString<'static>, description: TString<'static>,
allow_cancel: bool, allow_cancel: bool,
_time_ms: u32, time_ms: u32,
) -> Result<Gc<LayoutObj>, Error> { ) -> Result<Gc<LayoutObj>, Error> {
let paragraphs = Paragraph::new(&theme::TEXT_REGULAR, description) let paragraphs = Paragraph::new(&theme::TEXT_REGULAR, description)
.into_paragraphs() .into_paragraphs()
@ -845,6 +845,8 @@ impl FirmwareUI for UIEckhart {
Button::with_icon(theme::ICON_CROSS), Button::with_icon(theme::ICON_CROSS),
Button::with_text(button), Button::with_text(button),
) )
} else if time_ms > 0 {
ActionBar::new_timeout(Button::with_text(button), time_ms)
} else { } else {
ActionBar::new_single(Button::with_text(button)) ActionBar::new_single(Button::with_text(button))
}; };

View File

@ -364,6 +364,7 @@ def show_success(
content: str, content: str,
subheader: str | None = None, subheader: str | None = None,
button: str | None = None, button: str | None = None,
time_ms: int = 0,
) -> Awaitable[None]: ) -> Awaitable[None]:
button = button or TR.buttons__continue # def_arg button = button or TR.buttons__continue # def_arg
return raise_if_not_confirmed( return raise_if_not_confirmed(
@ -372,6 +373,7 @@ def show_success(
button=button, button=button,
description=content, description=content,
allow_cancel=False, allow_cancel=False,
time_ms=time_ms,
), ),
br_name, br_name,
ButtonRequestType.Success, ButtonRequestType.Success,