mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-30 01:58:11 +00:00
fix(core/ui): fix model R altcoin summary
[no changelog]
This commit is contained in:
parent
f8fcb49ba6
commit
68e01a48cb
@ -2,6 +2,7 @@ use crate::{
|
|||||||
strutil::TString,
|
strutil::TString,
|
||||||
ui::{
|
ui::{
|
||||||
component::{Child, Component, ComponentExt, Event, EventCtx, Pad, Paginate},
|
component::{Child, Component, ComponentExt, Event, EventCtx, Pad, Paginate},
|
||||||
|
constant::SCREEN,
|
||||||
geometry::Rect,
|
geometry::Rect,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -94,12 +95,16 @@ where
|
|||||||
/// position.
|
/// position.
|
||||||
fn change_current_page(&mut self, ctx: &mut EventCtx) {
|
fn change_current_page(&mut self, ctx: &mut EventCtx) {
|
||||||
self.current_page = self.pages.get(self.page_counter);
|
self.current_page = self.pages.get(self.page_counter);
|
||||||
|
if !self.has_common_title {
|
||||||
if let Some(title) = self.current_page.title() {
|
if let Some(title) = self.current_page.title() {
|
||||||
self.title = Some(Title::new(title));
|
self.title = Some(Title::new(title));
|
||||||
self.title.place(self.title_area);
|
|
||||||
} else {
|
} else {
|
||||||
self.title = None;
|
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
|
let scrollbar_active_index = self
|
||||||
.pages
|
.pages
|
||||||
.scrollbar_page_index(self.content_area, self.page_counter);
|
.scrollbar_page_index(self.content_area, self.page_counter);
|
||||||
|
@ -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 btn_actions = ButtonActions::cancel_confirm_next();
|
||||||
|
|
||||||
let ops = OpTextLayout::new(theme::TEXT_MONO)
|
let ops = OpTextLayout::new(theme::TEXT_MONO)
|
||||||
|
.text_bold(amount_title)
|
||||||
|
.newline()
|
||||||
.text_mono(amount_value)
|
.text_mono(amount_value)
|
||||||
.newline()
|
.newline()
|
||||||
.newline_half()
|
.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);
|
.text_mono(fee_value);
|
||||||
|
|
||||||
let formatted = FormattedText::new(ops);
|
let formatted = FormattedText::new(ops);
|
||||||
Page::new(btn_layout, btn_actions, formatted).with_title(amount_title)
|
Page::new(btn_layout, btn_actions, formatted)
|
||||||
}
|
}
|
||||||
1 => {
|
1 => {
|
||||||
// Other information
|
// Other information
|
||||||
|
Loading…
Reference in New Issue
Block a user