diff --git a/core/embed/rust/librust_qstr.h b/core/embed/rust/librust_qstr.h index 39c11d51a..50116a2f5 100644 --- a/core/embed/rust/librust_qstr.h +++ b/core/embed/rust/librust_qstr.h @@ -37,6 +37,7 @@ static void _librust_qstrs(void) { MP_QSTR_button; MP_QSTR_button_event; MP_QSTR_cancel_arrow; + MP_QSTR_cancel_cross; MP_QSTR_case_sensitive; MP_QSTR_check_homescreen_format; MP_QSTR_chunkify; diff --git a/core/embed/rust/src/ui/model_tr/layout.rs b/core/embed/rust/src/ui/model_tr/layout.rs index 096393020..7027b33a7 100644 --- a/core/embed/rust/src/ui/model_tr/layout.rs +++ b/core/embed/rust/src/ui/model_tr/layout.rs @@ -757,13 +757,18 @@ extern "C" fn new_altcoin_tx_summary(n_args: usize, args: *const Obj, kwargs: *m let amount_value: StrBuffer = kwargs.get(Qstr::MP_QSTR_amount_value)?.try_into()?; let fee_title: StrBuffer = kwargs.get(Qstr::MP_QSTR_fee_title)?.try_into()?; let fee_value: StrBuffer = kwargs.get(Qstr::MP_QSTR_fee_value)?.try_into()?; + let cancel_cross: bool = kwargs.get_or(Qstr::MP_QSTR_cancel_cross, false)?; let items: Obj = kwargs.get(Qstr::MP_QSTR_items)?; let get_page = move |page_index| { match page_index { 0 => { // Amount + fee - let btn_layout = ButtonLayout::up_arrow_armed_info("CONFIRM".into()); + let btn_layout = if cancel_cross { + ButtonLayout::cancel_armed_info("CONFIRM".into()); + } else { + ButtonLayout::up_arrow_armed_info("CONFIRM".into()); + }; let btn_actions = ButtonActions::cancel_confirm_next(); let ops = OpTextLayout::new(theme::TEXT_MONO) @@ -1802,6 +1807,7 @@ pub static mp_module_trezorui2: Module = obj_module! { /// fee_title: str, /// fee_amount: str, /// items: Iterable[Tuple[str, str]], + /// cancel_cross: bool = False, /// ) -> object: /// """Confirm details about altcoin transaction.""" Qstr::MP_QSTR_altcoin_tx_summary => obj_fn_kw!(0, new_altcoin_tx_summary).as_obj(), diff --git a/core/mocks/generated/trezorui2.pyi b/core/mocks/generated/trezorui2.pyi index abc970101..d9bf4bd42 100644 --- a/core/mocks/generated/trezorui2.pyi +++ b/core/mocks/generated/trezorui2.pyi @@ -176,6 +176,7 @@ def altcoin_tx_summary( fee_title: str, fee_amount: str, items: Iterable[Tuple[str, str]], + cancel_cross: bool = False, ) -> object: """Confirm details about altcoin transaction."""