1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-20 17:19:01 +00:00

chore(eckhart): Update components

Fix show_error action bar and header colors
Implement AllowedTextContent for FidoCredential
Add new return type for VerticalMenuScreen
This commit is contained in:
Lukas Bielesch 2025-04-12 23:53:31 +02:00
parent 2ade8f2217
commit 0b31a124c3
3 changed files with 12 additions and 3 deletions

View File

@ -16,7 +16,7 @@ use crate::{
use super::{
action_bar::ActionBarMsg,
theme::{self, SIDE_INSETS},
ActionBar, Header, HeaderMsg, Hint,
ActionBar, FidoCredential, Header, HeaderMsg, Hint,
};
/// Full-screen component for rendering text.
@ -179,6 +179,7 @@ pub trait AllowedTextContent: Component + PaginateFull {}
impl AllowedTextContent for FormattedText {}
impl<'a, T> AllowedTextContent for Paragraphs<T> where T: ParagraphSource<'a> {}
impl<'a, T> AllowedTextContent for Checklist<T> where T: ParagraphSource<'a> {}
impl<F> AllowedTextContent for FidoCredential<F> where F: Fn() -> TString<'static> {}
#[cfg(feature = "ui_debug")]
impl<T> crate::trace::Trace for TextScreen<T>

View File

@ -34,6 +34,8 @@ pub enum VerticalMenuScreenMsg {
Back,
/// Right header button clicked
Close,
/// Menu item selected
Menu,
}
impl VerticalMenuScreen {
@ -141,7 +143,7 @@ impl Component for VerticalMenuScreen {
match msg {
HeaderMsg::Cancelled => return Some(VerticalMenuScreenMsg::Close),
HeaderMsg::Back => return Some(VerticalMenuScreenMsg::Back),
_ => {}
HeaderMsg::Menu => return Some(VerticalMenuScreenMsg::Menu),
}
}

View File

@ -731,9 +731,15 @@ impl FirmwareUI for UIEckhart {
Button::with_icon(theme::ICON_CLOSE),
Button::with_text(button),
)
} else {
ActionBar::new_single(Button::with_text(button))
};
let screen = TextScreen::new(content)
.with_header(Header::new(title).with_icon(theme::ICON_WARNING, theme::RED))
.with_header(
Header::new(title)
.with_icon(theme::ICON_WARNING, theme::ORANGE)
.with_text_style(theme::label_title_danger()),
)
.with_action_bar(action_bar);
let obj = LayoutObj::new(screen)?;
Ok(obj)