1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-21 17:49:02 +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 f5473bd325
commit 2f10a5f5db
2 changed files with 5 additions and 1 deletions

View File

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

View File

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