From 36ad0cf7ce64d269d54c351fc584b3f3bb7380f1 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Thu, 3 Jul 2025 13:29:48 +0300 Subject: [PATCH] feat(core): implement `UIDelizia::show_properties()` [no changelog] --- .../rust/src/ui/layout_delizia/ui_firmware.rs | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs b/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs index 50a890c91f..204e1dc9b0 100644 --- a/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs +++ b/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs @@ -1083,10 +1083,31 @@ impl FirmwareUI for UIDelizia { } fn show_properties( - _title: TString<'static>, - _value: Obj, + title: TString<'static>, + value: Obj, ) -> Result { - Err::, 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::()? + .unwrap_or_else(TString::empty); + let text = text + .try_into_option::()? + .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(