mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-23 15:08:19 +00:00
feat(core): implement UIDelizia::show_properties()
[no changelog]
This commit is contained in:
parent
4222ca4b01
commit
36ad0cf7ce
@ -1083,10 +1083,31 @@ impl FirmwareUI for UIDelizia {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn show_properties(
|
fn show_properties(
|
||||||
_title: TString<'static>,
|
title: TString<'static>,
|
||||||
_value: Obj,
|
value: Obj,
|
||||||
) -> Result<impl LayoutMaybeTrace, Error> {
|
) -> Result<impl LayoutMaybeTrace, Error> {
|
||||||
Err::<RootComponent<Empty, ModelUI>, Error>(ERROR_NOT_IMPLEMENTED)
|
if Obj::is_str(value) {
|
||||||
|
let confirm = ConfirmValue::new(title, value, None)
|
||||||
|
.with_cancel_button()
|
||||||
|
.with_chunkify(true)
|
||||||
|
.with_text_mono(true);
|
||||||
|
let layout = confirm.into_layout()?;
|
||||||
|
return flow::util::single_page(layout.map(|_| Some(FlowMsg::Confirmed)));
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut params = ShowInfoParams::new(title).with_cancel_button();
|
||||||
|
for property in IterBuf::new().try_iterate(value)? {
|
||||||
|
let [header, text]: [Obj; 2] = util::iter_into_array(property)?;
|
||||||
|
let header = header
|
||||||
|
.try_into_option::<TString>()?
|
||||||
|
.unwrap_or_else(TString::empty);
|
||||||
|
let text = text
|
||||||
|
.try_into_option::<TString>()?
|
||||||
|
.unwrap_or_else(TString::empty);
|
||||||
|
params = unwrap!(params.add(header, text));
|
||||||
|
}
|
||||||
|
let layout = params.into_layout()?;
|
||||||
|
flow::util::single_page(layout.map(|_| Some(FlowMsg::Confirmed)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show_share_words(
|
fn show_share_words(
|
||||||
|
Loading…
Reference in New Issue
Block a user