From 5edb72ebe96f1ed6c93fae8818b1a7eb15da2b1e Mon Sep 17 00:00:00 2001 From: obrusvit Date: Sat, 1 Mar 2025 13:05:44 +0100 Subject: [PATCH] feat(eckhart): improve ActionBar content - button content is moved towards the center a bit - shrink left button at the last page of paginated component - change the order of render in `TextScreen` to account for Header overlay. If the main content reaches the Header area, we do not want to overlay it during Hold to Confirm animation --- .../src/ui/layout_eckhart/component/button.rs | 6 +- .../ui/layout_eckhart/firmware/action_bar.rs | 84 +++++++++++-------- .../ui/layout_eckhart/firmware/text_screen.rs | 2 +- 3 files changed, 53 insertions(+), 39 deletions(-) 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 b834e61d5b..f045089c44 100644 --- a/core/embed/rust/src/ui/layout_eckhart/component/button.rs +++ b/core/embed/rust/src/ui/layout_eckhart/component/button.rs @@ -256,7 +256,7 @@ impl Button { let y_offset = Offset::y(self.content_height() / 2); let start_of_baseline = match self.text_align { Alignment::Start => self.area.left_center() + self.content_offset, - Alignment::Center => self.area.center(), + Alignment::Center => self.area.center() + self.content_offset, Alignment::End => self.area.right_center() - self.content_offset, } + y_offset; text.map(|text| { @@ -273,7 +273,7 @@ impl Button { let subtext_y_offset = Offset::y(self.content_height() / 2); let start_of_baseline = match self.text_align { Alignment::Start => self.area.left_center() + self.content_offset, - Alignment::Center => self.area.center(), + Alignment::Center => self.area.center() + self.content_offset, Alignment::End => self.area.right_center() - self.content_offset, }; let text_baseline = start_of_baseline - text_y_offset; @@ -296,7 +296,7 @@ impl Button { }); } ButtonContent::Icon(icon) => { - shape::ToifImage::new(self.area.center(), icon.toif) + shape::ToifImage::new(self.area.center() + self.content_offset, icon.toif) .with_align(Alignment2D::CENTER) .with_fg(style.icon_color) .with_alpha(alpha) diff --git a/core/embed/rust/src/ui/layout_eckhart/firmware/action_bar.rs b/core/embed/rust/src/ui/layout_eckhart/firmware/action_bar.rs index 15085ef08d..a772fce1e2 100644 --- a/core/embed/rust/src/ui/layout_eckhart/firmware/action_bar.rs +++ b/core/embed/rust/src/ui/layout_eckhart/firmware/action_bar.rs @@ -22,9 +22,8 @@ pub struct ActionBar { /// Optional left button, can be shorter than the right one left_button: Option