diff --git a/core/embed/rust/src/ui/layout_eckhart/bootloader/welcome.rs b/core/embed/rust/src/ui/layout_eckhart/bootloader/welcome.rs index 2779b14de1..e2625a59af 100644 --- a/core/embed/rust/src/ui/layout_eckhart/bootloader/welcome.rs +++ b/core/embed/rust/src/ui/layout_eckhart/bootloader/welcome.rs @@ -1,13 +1,15 @@ use crate::ui::{ component::{Component, Event, EventCtx, Never, Pad}, constant::screen, - display::Font, geometry::{Offset, Point, Rect}, shape, shape::Renderer, }; -use super::super::theme::{BLACK, GREY, WHITE}; +use super::{ + super::theme::{BLACK, GREY, WHITE}, + fonts, +}; const TEXT_ORIGIN: Point = Point::new(0, 105); const STRIDE: i16 = 22; @@ -39,28 +41,26 @@ impl Component for Welcome { fn render<'s>(&'s self, target: &mut impl Renderer<'s>) { self.bg.render(target); - shape::Text::new(TEXT_ORIGIN, "Get started") - .with_font(Font::NORMAL) + let font = fonts::FONT_SATOSHI_REGULAR_38; + shape::Text::new(TEXT_ORIGIN, "Get started", font) .with_fg(GREY) .render(target); - shape::Text::new(TEXT_ORIGIN + Offset::y(STRIDE), "with your Trezor") - .with_font(Font::NORMAL) + shape::Text::new(TEXT_ORIGIN + Offset::y(STRIDE), "with your Trezor", font) .with_fg(GREY) .render(target); - shape::Text::new(TEXT_ORIGIN + Offset::y(2 * STRIDE), "at") - .with_font(Font::NORMAL) + shape::Text::new(TEXT_ORIGIN + Offset::y(2 * STRIDE), "at", font) .with_fg(GREY) .render(target); - let at_width = Font::NORMAL.text_width("at "); + let at_width = font.text_width("at "); shape::Text::new( TEXT_ORIGIN + Offset::new(at_width, 2 * STRIDE), "trezor.io/start", + font, ) - .with_font(Font::NORMAL) .with_fg(WHITE) .render(target); } diff --git a/core/embed/rust/src/ui/layout_eckhart/component/hint.rs b/core/embed/rust/src/ui/layout_eckhart/component/hint.rs index 3582bfb424..9bcab497f0 100644 --- a/core/embed/rust/src/ui/layout_eckhart/component/hint.rs +++ b/core/embed/rust/src/ui/layout_eckhart/component/hint.rs @@ -116,13 +116,11 @@ impl<'a> Component for Hint<'a> { let bounds = bounds.inset(Self::HINT_INSETS); match &mut self.content { HintContent::Instruction(instruction) => { - if let Some(icon) = instruction.icon { - let icon_width = instruction.icon_width(); - let text_area = bounds.split_left(icon_width).1; - instruction.label.place(text_area); - } else { - instruction.label.place(bounds); - } + let text_area = match instruction.icon { + Some(_) => bounds.split_left(instruction.icon_width()).1, + None => bounds, + }; + instruction.label.place(text_area); } _ => {} } diff --git a/core/embed/rust/src/ui/layout_eckhart/component/text_screen.rs b/core/embed/rust/src/ui/layout_eckhart/component/text_screen.rs index 6c3f973ec0..6b6a8a89e2 100644 --- a/core/embed/rust/src/ui/layout_eckhart/component/text_screen.rs +++ b/core/embed/rust/src/ui/layout_eckhart/component/text_screen.rs @@ -1,19 +1,16 @@ -use crate::{ - strutil::TString, - ui::{ - component::{ - swipe_detect::SwipeConfig, - text::paragraphs::{ParagraphSource, Paragraphs}, - Component, Event, EventCtx, FormattedText, PaginateFull, - }, - flow::Swipable, - geometry::{Insets, Rect}, - shape::Renderer, - util::Pager, +use crate::ui::{ + component::{ + swipe_detect::SwipeConfig, + text::paragraphs::{ParagraphSource, Paragraphs}, + Component, Event, EventCtx, FormattedText, PaginateFull, }, + flow::Swipable, + geometry::{Insets, Rect}, + shape::Renderer, + util::Pager, }; -use super::{action_bar::ActionBarMsg, button::Button, ActionBar, Header, HeaderMsg, Hint}; +pub(crate) use super::{action_bar::ActionBarMsg, ActionBar, Header, HeaderMsg, Hint}; /// Full-screen component for rendering text. /// diff --git a/core/embed/rust/src/ui/layout_eckhart/mod.rs b/core/embed/rust/src/ui/layout_eckhart/mod.rs index 0ba738e5fd..6c7c4990ad 100644 --- a/core/embed/rust/src/ui/layout_eckhart/mod.rs +++ b/core/embed/rust/src/ui/layout_eckhart/mod.rs @@ -1,6 +1,16 @@ use super::{geometry::Rect, CommonUI}; use theme::backlight; +#[cfg(feature = "ui_debug_overlay")] +use super::{ + display::Color, + geometry::{Alignment, Alignment2D, Offset, Point}, + shape, DebugOverlay, +}; + +#[cfg(feature = "ui_debug_overlay")] +use crate::strutil::ShortString; + #[cfg(feature = "bootloader")] pub mod bootloader; pub mod component; @@ -69,4 +79,34 @@ impl CommonUI for UIEckhart { fn screen_boot_stage_2(fade_in: bool) { screens::screen_boot_stage_2(fade_in); } + + #[cfg(feature = "ui_debug_overlay")] + fn render_debug_overlay<'s>(target: &mut impl shape::Renderer<'s>, info: DebugOverlay) { + let mut text = ShortString::new(); + let t1 = info.render_time.min(99999) as u32; + let t2 = info.refresh_time.min(99999) as u32; + unwrap!(ufmt::uwrite!( + text, + "{}.{}|{}.{}", + t1 / 1000, + (t1 % 1000) / 100, + t2 / 1000, + (t2 % 1000) / 100 + )); + let font = fonts::FONT_SATOSHI_REGULAR_22; + let size = Offset::new( + font.visible_text_width("00.0|00.0"), + font.visible_text_height("0"), + ); + let pos = Point::new(constant::WIDTH, 0); + let r = Rect::snap(pos, size, Alignment2D::TOP_RIGHT); + shape::Bar::new(r) + .with_alpha(192) + .with_bg(Color::black()) + .render(target); + shape::Text::new(r.bottom_right(), &text, font) + .with_align(Alignment::End) + .with_fg(Color::rgb(255, 255, 0)) + .render(target); + } } diff --git a/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs b/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs index ff2a14ce1e..4305031a13 100644 --- a/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs +++ b/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs @@ -8,7 +8,7 @@ use crate::{ component::{ text::{ op::OpTextLayout, - paragraphs::{Paragraph, ParagraphSource, ParagraphVecShort, Paragraphs, VecExt}, + paragraphs::{Paragraph, ParagraphSource, ParagraphVecShort, VecExt}, }, Empty, FormattedText, }, @@ -159,6 +159,7 @@ impl FirmwareUI for UIEckhart { _title: TString<'static>, _button: TString<'static>, _button_style_confirm: bool, + _hold: bool, _items: Obj, ) -> Result { Err::, Error>(Error::ValueError(c"not implemented")) @@ -204,7 +205,7 @@ impl FirmwareUI for UIEckhart { chunkify: bool, page_counter: bool, _prompt_screen: bool, - cancel: bool, + _cancel: bool, ) -> Result, Error> { let paragraphs = ConfirmValueParams { description: description.unwrap_or("".into()), @@ -258,6 +259,7 @@ impl FirmwareUI for UIEckhart { _subtitle: Option>, _verb: Option>, _verb_cancel: Option>, + _hold: bool, _chunkify: bool, ) -> Result, Error> { Err::, Error>(Error::ValueError(c"confirm_value_intro not implemented")) @@ -265,10 +267,10 @@ impl FirmwareUI for UIEckhart { fn confirm_with_info( _title: TString<'static>, - _button: TString<'static>, - _info_button: TString<'static>, - _verb_cancel: Option>, _items: Obj, + _verb: TString<'static>, + _verb_info: TString<'static>, + _verb_cancel: Option>, ) -> Result { Err::, Error>(Error::ValueError(c"not implemented")) } @@ -291,6 +293,7 @@ impl FirmwareUI for UIEckhart { fn flow_confirm_output( _title: Option>, _subtitle: Option>, + _description: Option>, _message: Obj, _amount: Option, _chunkify: bool, @@ -299,8 +302,8 @@ impl FirmwareUI for UIEckhart { _account_path: Option>, _br_code: u16, _br_name: TString<'static>, - _address: Option, - _address_title: Option>, + _address_item: Option<(TString<'static>, Obj)>, + _extra_item: Option<(TString<'static>, Obj)>, _summary_items: Option, _fee_items: Option, _summary_title: Option>, @@ -671,7 +674,7 @@ impl FirmwareUI for UIEckhart { value: TString<'static>, description: TString<'static>, allow_cancel: bool, - danger: bool, // TODO: review if `danger` needed in all layouts since we have show_danger + _danger: bool, // TODO: review if `danger` needed in all layouts since we have show_danger ) -> Result, Error> { let paragraphs = ParagraphVecShort::from_iter([ Paragraph::new(&theme::TEXT_SMALL, description), diff --git a/core/site_scons/ui/__init__.py b/core/site_scons/ui/__init__.py index 1811198b5f..97b779e8ff 100644 --- a/core/site_scons/ui/__init__.py +++ b/core/site_scons/ui/__init__.py @@ -15,7 +15,7 @@ def get_ui_module(model: str, stage: str): layout = models.get_model_ui(model) - if layout == "delizia" and stage == "prodtest": + if layout in ("delizia", "eckhart") and stage == "prodtest": layout = "bolt" return ui_modules[layout] diff --git a/core/translations/signatures.json b/core/translations/signatures.json index ab8022461c..3930cbafea 100644 --- a/core/translations/signatures.json +++ b/core/translations/signatures.json @@ -1,8 +1,8 @@ { "current": { - "merkle_root": "1754d367a3f9796a460e21677a38465ac51110a5abaae96a8977e64cd3d35e27", - "datetime": "2025-02-25T22:15:23.529862", - "commit": "ba8a64d3e42febd344f60f039b6ac21ffb36aa9c" + "merkle_root": "19d4e95a0a33b04208bf228d5e00dceb75e0f0a59fc2fde24a8c53a3f61f6866", + "datetime": "2025-02-26T14:55:24.158526", + "commit": "d2061b7671c84edd65033f7e22d65deda13cad06" }, "history": [ {