1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-01 16:06:07 +00:00

feat(eckhart): implement show_error

- initial implementation to be improved
This commit is contained in:
obrusvit 2025-03-17 13:37:07 +01:00
parent e2c07b6126
commit b70c31c98a

View File

@ -538,13 +538,28 @@ impl FirmwareUI for UIEckhart {
}
fn show_error(
_title: TString<'static>,
_button: TString<'static>,
_description: TString<'static>,
_allow_cancel: bool,
title: TString<'static>,
button: TString<'static>,
description: TString<'static>,
allow_cancel: bool,
_time_ms: u32,
) -> Result<Gc<LayoutObj>, Error> {
Err::<Gc<LayoutObj>, Error>(Error::ValueError(c"not implemented"))
let content = Paragraphs::new(Paragraph::new(&theme::firmware::TEXT_REGULAR, description))
.with_placement(LinearPlacement::vertical());
let action_bar = if allow_cancel {
ActionBar::new_single(Button::with_text(button))
} else {
ActionBar::new_double(
Button::with_icon(theme::ICON_CLOSE),
Button::with_text(button),
)
};
let screen = TextScreen::new(content)
.with_header(Header::new(title).with_icon(theme::ICON_WARNING, theme::RED))
.with_action_bar(action_bar);
let obj = LayoutObj::new(screen)?;
Ok(obj)
}
fn show_group_share_success(