From 68e01a48cbd62a58ded531477f19855cfcf1bb68 Mon Sep 17 00:00:00 2001 From: obrusvit Date: Wed, 17 Apr 2024 12:37:41 +0200 Subject: [PATCH] fix(core/ui): fix model R altcoin summary [no changelog] --- core/embed/rust/src/ui/model_tr/component/flow.rs | 15 ++++++++++----- core/embed/rust/src/ui/model_tr/layout.rs | 4 +++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/core/embed/rust/src/ui/model_tr/component/flow.rs b/core/embed/rust/src/ui/model_tr/component/flow.rs index 85a1bc8c41..f1363bdec6 100644 --- a/core/embed/rust/src/ui/model_tr/component/flow.rs +++ b/core/embed/rust/src/ui/model_tr/component/flow.rs @@ -2,6 +2,7 @@ use crate::{ strutil::TString, ui::{ component::{Child, Component, ComponentExt, Event, EventCtx, Pad, Paginate}, + constant::SCREEN, geometry::Rect, }, }; @@ -94,11 +95,15 @@ where /// position. fn change_current_page(&mut self, ctx: &mut EventCtx) { self.current_page = self.pages.get(self.page_counter); - if let Some(title) = self.current_page.title() { - self.title = Some(Title::new(title)); - self.title.place(self.title_area); - } else { - self.title = None; + if !self.has_common_title { + if let Some(title) = self.current_page.title() { + self.title = Some(Title::new(title)); + } else { + self.title = None; + } + // in case the title was added or removed, re-calculate the areas for + // subcomponents + self.place(SCREEN); } let scrollbar_active_index = self .pages diff --git a/core/embed/rust/src/ui/model_tr/layout.rs b/core/embed/rust/src/ui/model_tr/layout.rs index a20d593e0e..708f50b773 100644 --- a/core/embed/rust/src/ui/model_tr/layout.rs +++ b/core/embed/rust/src/ui/model_tr/layout.rs @@ -735,6 +735,8 @@ extern "C" fn new_altcoin_tx_summary(n_args: usize, args: *const Obj, kwargs: *m let btn_actions = ButtonActions::cancel_confirm_next(); let ops = OpTextLayout::new(theme::TEXT_MONO) + .text_bold(amount_title) + .newline() .text_mono(amount_value) .newline() .newline_half() @@ -743,7 +745,7 @@ extern "C" fn new_altcoin_tx_summary(n_args: usize, args: *const Obj, kwargs: *m .text_mono(fee_value); let formatted = FormattedText::new(ops); - Page::new(btn_layout, btn_actions, formatted).with_title(amount_title) + Page::new(btn_layout, btn_actions, formatted) } 1 => { // Other information