fix(core/eckhart): button text splitting
What changed, and why it matters
This is a tiny UI layout fix for the Trezor hardware wallet's 'Eckhart' design. When a button with two text labels is drawn, the code now uses the absolute value of a negative horizontal offset to correctly figure out how much room the text has. Without the fix, the available width could be calculated as larger than it really is, which might cause long button labels to be split awkwardly or overflow visually. There is no direct security signal here—this is a cosmetic/layout bug fix.
No security action required. Treat as a normal UI/layout fix and include in regular firmware QA for the Eckhart layout.
Security signals we found
No memory-safety, cryptographic, or authorization changes
UI layout/text measurement correction only
No input parsing, serialization, or privileged operation changes
No changelog entry requested by the author, consistent with minor UI fix
Evidence from the diff
In core/embed/rust/src/ui/layout_eckhart/component/button.rs, the ActionBar::Double button variant applies a negative content_offset.x for the right-hand button. The previous code subtracted 2 * self.content_offset.x from self.area.width() when calling split_two_lines(). With a negative offset, this arithmetic incorrectly increases the computed available width. The patch changes the calculation to self.area.width() - 2 * self.content_offset.x.abs(), ensuring the width reduction is always positive and symmetric for both buttons. This affects only text line-splitting logic for button labels on the Eckhart layout.
Changed components
core/embed/rust/src/ui/layout_eckhart/component/button.rsTrezor Core UI (Eckhart layout button rendering)Inspect captured patch +1 / −1
diff --git a/core/embed/rust/src/ui/layout_eckhart/component/button.rs b/core/embed/rust/src/ui/layout_eckhart/component/button.rs
index 374b875f3..524511c2f 100644
--- a/core/embed/rust/src/ui/layout_eckhart/component/button.rs
+++ b/core/embed/rust/src/ui/layout_eckhart/component/button.rs
@@ -493,7 +493,7 @@ impl Button {
let (t1, t2) = split_two_lines(
t,
stylesheet.font,
- self.area.width() - 2 * self.content_offset.x,
+ self.area.width() - 2 * self.content_offset.x.abs(),
);
if t1.is_empty() || t2.is_empty() {
Why this scored 17/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.