1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-28 18:38:39 +00:00

refactor(core): get rid of description_font_green

[no changelog]
This commit is contained in:
Ioan Bizău 2024-11-12 18:07:10 +01:00
parent 3b40950f7a
commit fc54ad1b77
8 changed files with 15 additions and 20 deletions

View File

@ -226,7 +226,6 @@ static void _librust_qstrs(void) {
MP_QSTR_decode;
MP_QSTR_deinit;
MP_QSTR_description;
MP_QSTR_description_font_green;
MP_QSTR_details_title;
MP_QSTR_device_name__change_template;
MP_QSTR_device_name__title;

View File

@ -374,10 +374,10 @@ extern "C" fn new_confirm_blob(n_args: usize, args: *const Obj, kwargs: *mut Map
let block = move |_args: &[Obj], kwargs: &Map| {
let title: TString = kwargs.get(Qstr::MP_QSTR_title)?.try_into()?;
let data: Obj = kwargs.get(Qstr::MP_QSTR_data)?;
let description: Option<TString> =
kwargs.get(Qstr::MP_QSTR_description)?.try_into_option()?;
let description_font_green: bool =
kwargs.get_or(Qstr::MP_QSTR_description_font_green, false)?;
let description: Option<TString> = kwargs
.get(Qstr::MP_QSTR_description)
.unwrap_or_else(|_| Obj::const_none())
.try_into_option()?;
let text_mono: bool = kwargs.get_or(Qstr::MP_QSTR_text_mono, true)?;
let extra: Option<TString> = kwargs
.get(Qstr::MP_QSTR_extra)
@ -408,10 +408,13 @@ extern "C" fn new_confirm_blob(n_args: usize, args: *const Obj, kwargs: *mut Map
.unwrap_or_else(|_| Obj::const_none())
.try_into_option()?;
let description_font = if description_font_green {
&theme::TEXT_SUB_GREEN_LIME
let (description, description_font) = if page_limit == Some(1) {
(
Some(TR::instructions__view_all_data.into()),
&theme::TEXT_SUB_GREEN_LIME,
)
} else {
&theme::TEXT_NORMAL
(description, &theme::TEXT_NORMAL)
};
ConfirmBlobParams::new(
@ -1248,7 +1251,6 @@ pub static mp_module_trezorui2: Module = obj_module! {
/// title: str,
/// data: str | bytes,
/// description: str | None,
/// description_font_green: bool = False,
/// text_mono: bool = True,
/// extra: str | None = None,
/// subtitle: str | None = None,

View File

@ -1700,7 +1700,6 @@ pub static mp_module_trezorui2: Module = obj_module! {
/// title: str,
/// data: str | bytes,
/// description: str | None,
/// description_font_green: bool = False,
/// text_mono: bool = True,
/// extra: str | None = None,
/// subtitle: str | None = None,

View File

@ -1794,7 +1794,6 @@ pub static mp_module_trezorui2: Module = obj_module! {
/// title: str,
/// data: str | bytes,
/// description: str | None,
/// description_font_green: bool = False,
/// text_mono: bool = True,
/// extra: str | None = None,
/// subtitle: str | None = None,

View File

@ -59,7 +59,6 @@ def confirm_blob(
title: str,
data: str | bytes,
description: str | None,
description_font_green: bool = False,
text_mono: bool = True,
extra: str | None = None,
subtitle: str | None = None,
@ -632,7 +631,6 @@ def confirm_blob(
title: str,
data: str | bytes,
description: str | None,
description_font_green: bool = False,
text_mono: bool = True,
extra: str | None = None,
subtitle: str | None = None,
@ -1204,7 +1202,6 @@ def confirm_blob(
title: str,
data: str | bytes,
description: str | None,
description_font_green: bool = False,
text_mono: bool = True,
extra: str | None = None,
subtitle: str | None = None,

View File

@ -480,9 +480,8 @@ def confirm_blob(
main_layout = trezorui2.confirm_blob(
title=title,
data=data,
description=TR.instructions__view_all_data,
description_font_green=True,
subtitle=subtitle,
description=None,
subtitle=description,
verb=verb,
verb_cancel=verb_cancel,
verb_info=TR.buttons__view_all_data,
@ -540,7 +539,7 @@ if not utils.BITCOIN_ONLY:
"confirm_data",
TR.ethereum__title_input_data,
data,
subtitle=TR.ethereum__data_size_template.format(data_total),
TR.ethereum__data_size_template.format(data_total),
verb=TR.buttons__confirm,
verb_cancel=TR.send__cancel_sign,
br_code=ButtonRequestType.SignTx,

View File

@ -638,7 +638,7 @@ if not utils.BITCOIN_ONLY:
"confirm_data",
TR.ethereum__title_input_data,
data,
subtitle=TR.ethereum__data_size_template.format(data_total),
TR.ethereum__data_size_template.format(data_total),
verb=TR.buttons__confirm,
verb_cancel=None,
br_code=ButtonRequestType.SignTx,

View File

@ -606,7 +606,7 @@ if not utils.BITCOIN_ONLY:
"confirm_data",
TR.ethereum__title_input_data,
data,
subtitle=TR.ethereum__data_size_template.format(data_total),
TR.ethereum__data_size_template.format(data_total),
verb=TR.buttons__confirm,
verb_cancel=None,
br_code=ButtonRequestType.SignTx,