From e55de99436732b58bbb4923f6af6b49c7d9c3a7b Mon Sep 17 00:00:00 2001 From: obrusvit Date: Mon, 23 Dec 2024 14:45:50 +0100 Subject: [PATCH] WIP feat(lincoln): homescreen - provisionary implementation for now --- .../rust/src/ui/model_lincoln/ui_firmware.rs | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/core/embed/rust/src/ui/model_lincoln/ui_firmware.rs b/core/embed/rust/src/ui/model_lincoln/ui_firmware.rs index 8d20201cfa..bba6fd0c32 100644 --- a/core/embed/rust/src/ui/model_lincoln/ui_firmware.rs +++ b/core/embed/rust/src/ui/model_lincoln/ui_firmware.rs @@ -4,7 +4,10 @@ use crate::{ micropython::{gc::Gc, list::List, obj::Obj}, strutil::TString, ui::{ - component::Empty, + component::{ + text::paragraphs::{Paragraph, ParagraphSource, ParagraphVecShort}, + Empty, + }, layout::{ obj::{LayoutMaybeTrace, LayoutObj, RootComponent}, util::RecoveryType, @@ -16,7 +19,7 @@ use crate::{ }, }; -use super::UILincoln; +use super::{theme, UILincoln}; impl FirmwareUI for UILincoln { fn confirm_action( @@ -380,12 +383,22 @@ impl FirmwareUI for UILincoln { } fn show_homescreen( - _label: TString<'static>, + label: TString<'static>, _hold: bool, - _notification: Option>, + notification: Option>, _notification_level: u8, ) -> Result { - Err::, Error>(Error::ValueError(c"not implemented")) + let paragraphs = ParagraphVecShort::from_iter([ + Paragraph::new(&theme::TEXT_NORMAL, label), + Paragraph::new( + &theme::TEXT_NORMAL, + notification.unwrap_or(TString::empty()), + ), + ]) + .into_paragraphs(); + + let layout = RootComponent::new(paragraphs); + Ok(layout) } fn show_info(