From 8b04cb2d7ba0cd18c07b7cd4bc53b3135ce7423e Mon Sep 17 00:00:00 2001 From: obrusvit Date: Thu, 13 Mar 2025 16:21:59 +0100 Subject: [PATCH] feat(eckhart): implement confirm_emphasized --- .../rust/src/ui/layout_eckhart/ui_firmware.rs | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) 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 166002383c..1beefa3845 100644 --- a/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs +++ b/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs @@ -119,11 +119,39 @@ impl FirmwareUI for UIEckhart { } fn confirm_emphasized( - _title: TString<'static>, - _items: Obj, - _verb: Option>, + title: TString<'static>, + items: Obj, + verb: Option>, ) -> Result { - Err::, Error>(Error::ValueError(c"not implemented")) + let font = fonts::FONT_SATOSHI_REGULAR_38; + let text_style = theme::firmware::TEXT_REGULAR; + let mut ops = OpTextLayout::new(text_style); + + for item in IterBuf::new().try_iterate(items)? { + if item.is_str() { + ops = ops.text(TString::try_from(item)?, font) + } else { + let [emphasis, text]: [Obj; 2] = util::iter_into_array(item)?; + let text: TString = text.try_into()?; + if emphasis.try_into()? { + ops = ops.color(theme::WHITE); + ops = ops.text(text, font); + ops = ops.color(text_style.text_color); + } else { + ops = ops.text(text, font); + } + } + } + let text = FormattedText::new(ops); + let action_bar = ActionBar::new_double( + Button::with_icon(theme::ICON_CROSS), + Button::with_text(verb.unwrap_or(TR::buttons__confirm.into())), + ); + let screen = TextScreen::new(text) + .with_header(Header::new(title)) + .with_action_bar(action_bar); + let layout = RootComponent::new(screen); + Ok(layout) } fn confirm_fido(