chore(core): add default params to propslist
What changed, and why it matters
This is a routine code cleanup in the Trezor hardware wallet's user interface layer. It moves default font and spacing choices for a UI component called PropsList into each device's theme file, so callers can use a simpler constructor. There is no change to security logic, cryptography, or how user data is handled.
No security action required. This is a benign refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors PropsList construction in the Rust UI code. It introduces per-layout theme constants (PROPS_KEY_FONT, PROPS_VALUE_FONT, PROPS_VALUE_MONO_FONT, PROP_INNER_SPACING, PROPS_SPACING) and a new PropsList::new() method that uses those defaults, while preserving PropsList::new_styled() for explicit styling. Call sites across layout_bolt, layout_caesar, layout_delizia, and layout_eckhart are updated to use the simpler constructor where appropriate. The Eckhart layout retains some explicit new_styled() calls for screens that need non-default fonts. No functional security behavior is altered.
Changed components
core/embed/rust/src/ui/layout/util.rscore/embed/rust/src/ui/layout_bolt/theme/mod.rscore/embed/rust/src/ui/layout_bolt/ui_firmware.rscore/embed/rust/src/ui/layout_caesar/theme/mod.rscore/embed/rust/src/ui/layout_delizia/theme/mod.rscore/embed/rust/src/ui/layout_delizia/ui_firmware.rscore/embed/rust/src/ui/layout_eckhart/flow/confirm_output.rscore/embed/rust/src/ui/layout_eckhart/flow/confirm_summary.rscore/embed/rust/src/ui/layout_eckhart/theme/firmware.rscore/embed/rust/src/ui/layout_eckhart/theme/mod.rscore/embed/rust/src/ui/layout_eckhart/ui_firmware.rsInspect captured patch +60 / −83
diff --git a/core/.changelog.d/5420.added b/core/.changelog.d/5420.added
new file mode 100644
index 00000000..8857085c
--- /dev/null
+++ b/core/.changelog.d/5420.added
@@ -0,0 +1 @@
+Add new spacing parameters to Propslist.
diff --git a/core/embed/rust/src/ui/layout/util.rs b/core/embed/rust/src/ui/layout/util.rs
index d90a6111..0029f6e9 100644
--- a/core/embed/rust/src/ui/layout/util.rs
+++ b/core/embed/rust/src/ui/layout/util.rs
@@ -19,6 +19,24 @@ use crate::{
},
};
+cfg_if::cfg_if! {
+ if #[cfg(feature = "layout_bolt")] {
+ use crate::ui::layout_bolt::theme;
+ } else if #[cfg(feature = "layout_caesar")] {
+ use crate::ui::layout_caesar::theme;
+ } else if #[cfg(feature = "layout_delizia")] {
+ use crate::ui::layout_delizia::theme;
+ } else if #[cfg(feature = "layout_eckhart")] {
+ use crate::ui::layout_eckhart::theme;
+ } else {
+ compile_error!("Non supported layout feature enabled");
+ }
+}
+
+use theme::{
+ PROPS_KEY_FONT, PROPS_SPACING, PROPS_VALUE_FONT, PROPS_VALUE_MONO_FONT, PROP_INNER_SPACING,
+};
+
/// Maximum number of characters that can be displayed on screen at once. Used
/// for on-the-fly conversion of binary data to hexadecimal representation.
/// NOTE: can be fine-tuned for particular model screen to decrease memory
@@ -97,7 +115,7 @@ pub struct PropsList {
}
impl PropsList {
- pub fn new(
+ pub fn new_styled(
obj: Obj,
key_font: &'static TextStyle,
value_font: &'static TextStyle,
@@ -115,22 +133,20 @@ impl PropsList {
})
}
- pub fn empty(
- key_font: &'static TextStyle,
- value_font: &'static TextStyle,
- value_mono_font: &'static TextStyle,
- key_value_padding: i16,
- props_padding: i16,
- ) -> Result<Self, Error> {
+ pub fn new(obj: Obj) -> Result<Self, Error> {
+ Self::new_styled(
+ obj,
+ &PROPS_KEY_FONT,
+ &PROPS_VALUE_FONT,
+ &PROPS_VALUE_MONO_FONT,
+ PROP_INNER_SPACING,
+ PROPS_SPACING,
+ )
+ }
+
+ pub fn empty() -> Result<Self, Error> {
let empty_list = List::alloc(&[])?; // Create an empty GC list
- Ok(Self {
- items: empty_list,
- key_font,
- value_font,
- value_mono_font,
- key_value_padding,
- props_padding,
- })
+ Self::new(empty_list.into())
}
}
diff --git a/core/embed/rust/src/ui/layout_bolt/theme/mod.rs b/core/embed/rust/src/ui/layout_bolt/theme/mod.rs
index 0fa15625..05261b65 100644
--- a/core/embed/rust/src/ui/layout_bolt/theme/mod.rs
+++ b/core/embed/rust/src/ui/layout_bolt/theme/mod.rs
@@ -670,6 +670,9 @@ pub const RESULT_FOOTER_HEIGHT: i16 = 62;
// props settings
pub const PROP_INNER_SPACING: i16 = PARAGRAPH_BOTTOM_SPACE;
pub const PROPS_SPACING: i16 = PARAGRAPH_BOTTOM_SPACE;
+pub const PROPS_KEY_FONT: TextStyle = TEXT_NORMAL;
+pub const PROPS_VALUE_FONT: TextStyle = TEXT_MONO;
+pub const PROPS_VALUE_MONO_FONT: TextStyle = TEXT_MONO_DATA;
// checklist settings
pub const CHECKLIST_CHECK_WIDTH: i16 = 16;
diff --git a/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs b/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs
index 4c5c019b..2c6d0434 100644
--- a/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs
+++ b/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs
@@ -394,14 +394,7 @@ impl FirmwareUI for UIBolt {
_verb: Option<TString<'static>>,
_external_menu: bool,
) -> Result<impl LayoutMaybeTrace, Error> {
- let paragraphs = PropsList::new(
- items,
- &theme::TEXT_NORMAL,
- &theme::TEXT_MONO,
- &theme::TEXT_MONO_DATA,
- theme::PROP_INNER_SPACING,
- theme::PROPS_SPACING,
- )?;
+ let paragraphs = PropsList::new(items)?;
let page = if hold {
ButtonPage::new(paragraphs.into_paragraphs(), theme::BG).with_hold()?
} else {
diff --git a/core/embed/rust/src/ui/layout_caesar/theme/mod.rs b/core/embed/rust/src/ui/layout_caesar/theme/mod.rs
index c4ca1a6b..bf72d1ae 100644
--- a/core/embed/rust/src/ui/layout_caesar/theme/mod.rs
+++ b/core/embed/rust/src/ui/layout_caesar/theme/mod.rs
@@ -99,6 +99,9 @@ include_icon!(ICON_WARN_TITLE, "layout_caesar/res/bld_header_warn.toif");
// props settings
pub const PROP_INNER_SPACING: i16 = PARAGRAPH_BOTTOM_SPACE;
pub const PROPS_SPACING: i16 = PARAGRAPH_BOTTOM_SPACE;
+pub const PROPS_KEY_FONT: TextStyle = TEXT_BOLD;
+pub const PROPS_VALUE_FONT: TextStyle = TEXT_MONO;
+pub const PROPS_VALUE_MONO_FONT: TextStyle = TEXT_MONO_DATA;
// checklist settings
pub const CHECKLIST_SPACING: i16 = 5;
diff --git a/core/embed/rust/src/ui/layout_delizia/theme/mod.rs b/core/embed/rust/src/ui/layout_delizia/theme/mod.rs
index 5fd3e43e..ca362f01 100644
--- a/core/embed/rust/src/ui/layout_delizia/theme/mod.rs
+++ b/core/embed/rust/src/ui/layout_delizia/theme/mod.rs
@@ -833,6 +833,9 @@ pub const DETAILS_SPACING: i16 = 8;
// props settings
pub const PROP_INNER_SPACING: i16 = PARAGRAPH_BOTTOM_SPACE;
pub const PROPS_SPACING: i16 = PARAGRAPH_BOTTOM_SPACE;
+pub const PROPS_KEY_FONT: TextStyle = TEXT_SUB_GREY_LIGHT;
+pub const PROPS_VALUE_FONT: TextStyle = TEXT_MONO;
+pub const PROPS_VALUE_MONO_FONT: TextStyle = TEXT_MONO_DATA;
// checklist settings
pub const CHECKLIST_CHECK_WIDTH: i16 = 32; // icon width (20px) + padding (12px)
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 33fadd88..4b80a866 100644
--- a/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs
+++ b/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs
@@ -452,14 +452,7 @@ impl FirmwareUI for UIDelizia {
_verb: Option<TString<'static>>,
_external_menu: bool,
) -> Result<impl LayoutMaybeTrace, Error> {
- let paragraphs = PropsList::new(
- items,
- &theme::TEXT_SUB_GREY_LIGHT,
- &theme::TEXT_MONO,
- &theme::TEXT_MONO_DATA,
- theme::PROP_INNER_SPACING,
- theme::PROPS_SPACING,
- )?;
+ let paragraphs = PropsList::new(items)?;
let flow = flow::new_confirm_action_simple(
paragraphs.into_paragraphs(),
diff --git a/core/embed/rust/src/ui/layout_eckhart/flow/confirm_output.rs b/core/embed/rust/src/ui/layout_eckhart/flow/confirm_output.rs
index 9dad52b3..c5a89858 100644
--- a/core/embed/rust/src/ui/layout_eckhart/flow/confirm_output.rs
+++ b/core/embed/rust/src/ui/layout_eckhart/flow/confirm_output.rs
@@ -485,15 +485,7 @@ pub fn new_confirm_output(
content_menu_info(
TR::confirm_total__title_fee.into(),
None,
- fee_paragraphs.unwrap_or_else(|| {
- unwrap!(PropsList::empty(
- &theme::TEXT_SMALL_LIGHT,
- &theme::TEXT_MONO_MEDIUM_LIGHT,
- &theme::TEXT_MONO_MEDIUM_LIGHT,
- theme::PROP_INNER_SPACING,
- theme::PROPS_SPACING,
- ))
- }),
+ fee_paragraphs.unwrap_or_else(|| unwrap!(PropsList::empty())),
),
)?
.add_page(
diff --git a/core/embed/rust/src/ui/layout_eckhart/flow/confirm_summary.rs b/core/embed/rust/src/ui/layout_eckhart/flow/confirm_summary.rs
index 47f10d57..8a7bbb4e 100644
--- a/core/embed/rust/src/ui/layout_eckhart/flow/confirm_summary.rs
+++ b/core/embed/rust/src/ui/layout_eckhart/flow/confirm_summary.rs
@@ -180,30 +180,14 @@ pub fn new_confirm_summary(
let content_extra = content_menu_info(
extra_title.unwrap_or(TR::buttons__more_info.into()),
None,
- extra_paragraphs.unwrap_or_else(|| {
- unwrap!(PropsList::empty(
- &theme::TEXT_SMALL_LIGHT,
- &theme::TEXT_MONO_LIGHT,
- &theme::TEXT_MONO_LIGHT,
- theme::PROP_INNER_SPACING,
- theme::PROPS_SPACING,
- ))
- }),
+ extra_paragraphs.unwrap_or_else(|| unwrap!(PropsList::empty())),
);
// AccountInfo
let content_account = content_menu_info(
account_title.unwrap_or(TR::address_details__account_info.into()),
Some(TR::send__send_from.into()),
- account_paragraphs.unwrap_or_else(|| {
- unwrap!(PropsList::empty(
- &theme::TEXT_SMALL_LIGHT,
- &theme::TEXT_MONO_LIGHT,
- &theme::TEXT_MONO_LIGHT,
- theme::PROP_INNER_SPACING,
- theme::PROPS_SPACING,
- ))
- }),
+ account_paragraphs.unwrap_or_else(|| unwrap!(PropsList::empty())),
);
// Cancel
diff --git a/core/embed/rust/src/ui/layout_eckhart/theme/firmware.rs b/core/embed/rust/src/ui/layout_eckhart/theme/firmware.rs
index 061c7102..8417ed2a 100644
--- a/core/embed/rust/src/ui/layout_eckhart/theme/firmware.rs
+++ b/core/embed/rust/src/ui/layout_eckhart/theme/firmware.rs
@@ -14,6 +14,13 @@ use super::{
*,
};
+// props settings
+pub const PROP_INNER_SPACING: i16 = 12; // [px]
+pub const PROPS_SPACING: i16 = 16; // [px]
+pub const PROPS_KEY_FONT: TextStyle = TEXT_SMALL_LIGHT;
+pub const PROPS_VALUE_FONT: TextStyle = TEXT_MONO_LIGHT;
+pub const PROPS_VALUE_MONO_FONT: TextStyle = TEXT_MONO_LIGHT;
+
pub const CONFIRM_HOLD_DURATION: ShortDuration = ShortDuration::from_millis(1500);
pub const ERASE_HOLD_DURATION: ShortDuration = ShortDuration::from_millis(1500);
/// Duration for the battery status showcase on the ActionBar or Header
diff --git a/core/embed/rust/src/ui/layout_eckhart/theme/mod.rs b/core/embed/rust/src/ui/layout_eckhart/theme/mod.rs
index 8f26ec51..2c2f410d 100644
--- a/core/embed/rust/src/ui/layout_eckhart/theme/mod.rs
+++ b/core/embed/rust/src/ui/layout_eckhart/theme/mod.rs
@@ -65,10 +65,6 @@ pub const SIDE_INSETS: Insets = Insets::sides(PADDING);
pub const ACTION_BAR_HEIGHT: i16 = 90; // [px]
pub const TEXT_VERTICAL_SPACING: i16 = 24; // [px]
-// props settings
-pub const PROP_INNER_SPACING: i16 = 12; // [px]
-pub const PROPS_SPACING: i16 = 16; // [px]
-
// checklist settings
pub const CHECKLIST_CHECK_WIDTH: i16 = 32; // [px]
pub const CHECKLIST_SPACING: i16 = 40; // [px]
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 198dcef1..7f7aa517 100644
--- a/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs
+++ b/core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs
@@ -347,26 +347,12 @@ impl FirmwareUI for UIEckhart {
) -> Result<impl LayoutMaybeTrace, Error> {
// collect available info
let account_paragraphs = if let Some(items) = account_items {
- Some(PropsList::new(
- items,
- &theme::TEXT_SMALL_LIGHT,
- &theme::TEXT_MONO_LIGHT,
- &theme::TEXT_MONO_LIGHT,
- theme::PROP_INNER_SPACING,
- theme::PROPS_SPACING,
- )?)
+ Some(PropsList::new(items)?)
} else {
None
};
let extra_paragraphs = if let Some(items) = extra_items {
- Some(PropsList::new(
- items,
- &theme::TEXT_SMALL_LIGHT,
- &theme::TEXT_MONO_LIGHT,
- &theme::TEXT_MONO_LIGHT,
- theme::PROP_INNER_SPACING,
- theme::PROPS_SPACING,
- )?)
+ Some(PropsList::new(items)?)
} else {
None
};
@@ -395,7 +381,7 @@ impl FirmwareUI for UIEckhart {
verb: Option<TString<'static>>,
_external_menu: bool,
) -> Result<impl LayoutMaybeTrace, Error> {
- let paragraphs = PropsList::new(
+ let paragraphs = PropsList::new_styled(
items,
&theme::TEXT_SMALL_LIGHT,
&theme::TEXT_MONO_MEDIUM_LIGHT,
@@ -743,7 +729,7 @@ impl FirmwareUI for UIEckhart {
};
let summary_paragraphs = if let Some(items) = summary_items {
- Some(PropsList::new(
+ Some(PropsList::new_styled(
items,
&theme::TEXT_SMALL_LIGHT,
&theme::TEXT_MONO_MEDIUM_LIGHT,
@@ -756,7 +742,7 @@ impl FirmwareUI for UIEckhart {
};
let fee_paragraphs = if let Some(items) = fee_items {
- Some(PropsList::new(
+ Some(PropsList::new_styled(
items,
&theme::TEXT_SMALL_LIGHT,
&theme::TEXT_MONO_MEDIUM_LIGHT,
@@ -1294,7 +1280,7 @@ impl FirmwareUI for UIEckhart {
&theme::TEXT_MONO_LIGHT
};
- let paragraphs = PropsList::new(
+ let paragraphs = PropsList::new_styled(
items,
&theme::TEXT_SMALL_LIGHT,
&theme::TEXT_MONO_MEDIUM_LIGHT,
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.