1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-08-01 19:38:33 +00:00

WIP - decrease the font size in Flow pages

This commit is contained in:
grdddj 2022-11-05 17:25:53 +01:00
parent 99563a973e
commit 33a8312fe3
3 changed files with 8 additions and 6 deletions

View File

@ -143,7 +143,9 @@ where
let (title_content_area, button_area) = bounds.split_bottom(theme::BUTTON_HEIGHT); let (title_content_area, button_area) = bounds.split_bottom(theme::BUTTON_HEIGHT);
// Accounting for possible title // Accounting for possible title
let content_area = if self.common_title.is_some() { let content_area = if self.common_title.is_some() {
title_content_area.split_top(10).1 title_content_area
.split_top(theme::FONT_HEADER.line_height())
.1
} else { } else {
title_content_area title_content_area
}; };

View File

@ -191,7 +191,7 @@ impl<const M: usize> Page<M> {
impl<const M: usize> Page<M> { impl<const M: usize> Page<M> {
pub fn icon_label_text(self, icon: IconAndName, label: StrBuffer, text: StrBuffer) -> Self { pub fn icon_label_text(self, icon: IconAndName, label: StrBuffer, text: StrBuffer) -> Self {
self.icon_with_offset(icon, 3) self.icon_with_offset(icon, 3)
.text_normal(label) .text_mono(label)
.newline() .newline()
.text_bold(text) .text_bold(text)
} }

View File

@ -201,7 +201,7 @@ extern "C" fn confirm_output(n_args: usize, args: *const Obj, kwargs: *mut Map)
let truncated_address: StrBuffer = let truncated_address: StrBuffer =
kwargs.get(Qstr::MP_QSTR_truncated_address)?.try_into()?; kwargs.get(Qstr::MP_QSTR_truncated_address)?.try_into()?;
let amount: StrBuffer = kwargs.get(Qstr::MP_QSTR_amount)?.try_into()?; let amount: StrBuffer = kwargs.get(Qstr::MP_QSTR_amount)?.try_into()?;
let title: StrBuffer = "Send".into(); let title: StrBuffer = "SEND".into();
let get_page = move |page_index| { let get_page = move |page_index| {
// Showing two screens - the recipient address and summary confirmation // Showing two screens - the recipient address and summary confirmation
@ -214,7 +214,7 @@ extern "C" fn confirm_output(n_args: usize, args: *const Obj, kwargs: *mut Map)
Some(ButtonDetails::text("CONTINUE")), Some(ButtonDetails::text("CONTINUE")),
); );
let btn_actions = ButtonActions::cancel_next(); let btn_actions = ButtonActions::cancel_next();
Page::<20>::new(btn_layout, btn_actions, Font::NORMAL).icon_label_text( Page::<20>::new(btn_layout, btn_actions, Font::MONO).icon_label_text(
theme::ICON_USER, theme::ICON_USER,
"Recipient".into(), "Recipient".into(),
address.clone(), address.clone(),
@ -231,7 +231,7 @@ extern "C" fn confirm_output(n_args: usize, args: *const Obj, kwargs: *mut Map)
), ),
); );
let btn_actions = ButtonActions::cancel_confirm(); let btn_actions = ButtonActions::cancel_confirm();
Page::<20>::new(btn_layout, btn_actions, Font::NORMAL) Page::<20>::new(btn_layout, btn_actions, Font::MONO)
.icon_label_text( .icon_label_text(
theme::ICON_USER, theme::ICON_USER,
"Recipient".into(), "Recipient".into(),
@ -273,7 +273,7 @@ extern "C" fn confirm_total(n_args: usize, args: *const Obj, kwargs: *mut Map) -
); );
let btn_actions = ButtonActions::cancel_confirm(); let btn_actions = ButtonActions::cancel_confirm();
let mut flow_page = Page::<25>::new(btn_layout, btn_actions, Font::NORMAL) let mut flow_page = Page::<25>::new(btn_layout, btn_actions, Font::MONO)
.icon_label_text(theme::ICON_PARAM, total_label.clone(), total_amount.clone()) .icon_label_text(theme::ICON_PARAM, total_label.clone(), total_amount.clone())
.newline() .newline()
.icon_label_text(theme::ICON_PARAM, fee_label.clone(), fee_amount.clone()); .icon_label_text(theme::ICON_PARAM, fee_label.clone(), fee_amount.clone());