mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-05-28 19:58:45 +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
81e523885a
commit
ebf1ee9a62
@ -16,7 +16,7 @@ use crate::{
|
||||
use super::{
|
||||
action_bar::ActionBarMsg,
|
||||
theme::{self, SIDE_INSETS},
|
||||
ActionBar, Header, HeaderMsg, Hint,
|
||||
ActionBar, FidoAccountName, FidoCredential, Header, HeaderMsg, Hint,
|
||||
};
|
||||
|
||||
/// Full-screen component for rendering text.
|
||||
@ -128,6 +128,8 @@ where
|
||||
}
|
||||
|
||||
fn event(&mut self, ctx: &mut EventCtx, event: Event) -> Option<Self::Msg> {
|
||||
self.content.event(ctx, event);
|
||||
|
||||
if let Some(msg) = self.header.event(ctx, event) {
|
||||
match msg {
|
||||
HeaderMsg::Cancelled => return Some(TextScreenMsg::Cancelled),
|
||||
@ -179,6 +181,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: FidoAccountName {}
|
||||
|
||||
#[cfg(feature = "ui_debug")]
|
||||
impl<T> crate::trace::Trace for TextScreen<T>
|
||||
|
@ -33,6 +33,8 @@ pub enum VerticalMenuScreenMsg {
|
||||
Back,
|
||||
/// Right header button clicked
|
||||
Close,
|
||||
/// Menu item selected
|
||||
Menu,
|
||||
}
|
||||
|
||||
impl VerticalMenuScreen {
|
||||
@ -189,7 +191,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),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -729,9 +729,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