1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-05 04:50:57 +00:00

WIP feat(lincoln): homescreen

- provisionary implementation for now
This commit is contained in:
obrusvit 2024-12-23 14:45:50 +01:00
parent fe93b86b43
commit e55de99436

View File

@ -4,7 +4,10 @@ use crate::{
micropython::{gc::Gc, list::List, obj::Obj}, micropython::{gc::Gc, list::List, obj::Obj},
strutil::TString, strutil::TString,
ui::{ ui::{
component::Empty, component::{
text::paragraphs::{Paragraph, ParagraphSource, ParagraphVecShort},
Empty,
},
layout::{ layout::{
obj::{LayoutMaybeTrace, LayoutObj, RootComponent}, obj::{LayoutMaybeTrace, LayoutObj, RootComponent},
util::RecoveryType, util::RecoveryType,
@ -16,7 +19,7 @@ use crate::{
}, },
}; };
use super::UILincoln; use super::{theme, UILincoln};
impl FirmwareUI for UILincoln { impl FirmwareUI for UILincoln {
fn confirm_action( fn confirm_action(
@ -380,12 +383,22 @@ impl FirmwareUI for UILincoln {
} }
fn show_homescreen( fn show_homescreen(
_label: TString<'static>, label: TString<'static>,
_hold: bool, _hold: bool,
_notification: Option<TString<'static>>, notification: Option<TString<'static>>,
_notification_level: u8, _notification_level: u8,
) -> Result<impl LayoutMaybeTrace, Error> { ) -> Result<impl LayoutMaybeTrace, Error> {
Err::<RootComponent<Empty, ModelUI>, 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( fn show_info(