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:
parent
2ade8f2217
commit
0b31a124c3
@ -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>
|
||||
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user