diff --git a/core/embed/rust/src/trezorhal/bitblt.rs b/core/embed/rust/src/trezorhal/bitblt.rs index a234cd302..e00cb114c 100644 --- a/core/embed/rust/src/trezorhal/bitblt.rs +++ b/core/embed/rust/src/trezorhal/bitblt.rs @@ -66,8 +66,8 @@ impl ffi::gfx_bitblt_t { /// # SAFETY /// 1) Ensure that the rectangle is completely inside the destination /// bitmap. - /// 2) If the copy or blend operation is used, ensure that the rectangle - /// is completely filled with source bitmap or its part. + /// 2) If the copy or blend operation is used, ensure that the rectangle is + /// completely filled with source bitmap or its part. unsafe fn with_rect(self, r: Rect) -> Self { Self { width: r.width() as u16, diff --git a/core/embed/rust/src/ui/model_tr/layout.rs b/core/embed/rust/src/ui/model_tr/layout.rs index 7342274bb..36e209523 100644 --- a/core/embed/rust/src/ui/model_tr/layout.rs +++ b/core/embed/rust/src/ui/model_tr/layout.rs @@ -512,7 +512,7 @@ extern "C" fn new_confirm_joint_total(n_args: usize, args: *const Obj, kwargs: * ]); content_in_button_page( - TR::joint__title.try_into()?, + TR::joint__title.into(), paragraphs, TR::buttons__hold_to_confirm.into(), Some("".into()), @@ -542,7 +542,7 @@ extern "C" fn new_confirm_modify_output(n_args: usize, args: *const Obj, kwargs: ]); content_in_button_page( - TR::modify_amount__title.try_into()?, + TR::modify_amount__title.into(), paragraphs, TR::buttons__confirm.into(), Some("".into()), @@ -914,7 +914,7 @@ extern "C" fn new_confirm_modify_fee(n_args: usize, args: *const Obj, kwargs: *m } content_in_button_page( - TR::modify_fee__title.try_into()?, + TR::modify_fee__title.into(), paragraphs_vec.into_paragraphs(), TR::buttons__confirm.into(), Some("".into()), @@ -1099,7 +1099,7 @@ extern "C" fn new_show_info(n_args: usize, args: *const Obj, kwargs: *mut Map) - extern "C" fn new_show_passphrase() -> Obj { let block = move || { - let text: TString = TR::passphrase__please_enter.try_into()?; + let text: TString = TR::passphrase__please_enter.into(); let paragraph = Paragraph::new(&theme::TEXT_NORMAL, text).centered(); let content = Paragraphs::new([paragraph]); let obj = LayoutObj::new(content)?; @@ -1223,7 +1223,7 @@ extern "C" fn new_confirm_coinjoin(n_args: usize, args: *const Obj, kwargs: *mut ]); content_in_button_page( - TR::coinjoin__title.try_into()?, + TR::coinjoin__title.into(), paragraphs, TR::buttons__hold_to_confirm.into(), None, @@ -1418,7 +1418,7 @@ extern "C" fn new_confirm_recovery(n_args: usize, args: *const Obj, kwargs: *mut }; content_in_button_page( - title.try_into()?, + title.into(), paragraphs.into_paragraphs(), button, Some("".into()), @@ -1430,7 +1430,7 @@ extern "C" fn new_confirm_recovery(n_args: usize, args: *const Obj, kwargs: *mut extern "C" fn new_select_word_count(n_args: usize, args: *const Obj, kwargs: *mut Map) -> Obj { let block = |_args: &[Obj], _kwargs: &Map| { - let title: TString = TR::word_count__title.try_into()?; + let title: TString = TR::word_count__title.into(); let choices: Vec, 5> = ["12", "18", "20", "24", "33"] .map(|num| num.into()) diff --git a/core/embed/rust/src/ui/model_tt/component/loader.rs b/core/embed/rust/src/ui/model_tt/component/loader.rs index b876451ad..22efb9abd 100644 --- a/core/embed/rust/src/ui/model_tt/component/loader.rs +++ b/core/embed/rust/src/ui/model_tt/component/loader.rs @@ -7,7 +7,6 @@ use crate::{ component::{Component, Event, EventCtx, Pad}, display::{self, toif::Icon, Color}, geometry::{Alignment2D, Offset, Rect}, - lerp::Lerp, model_tt::constant, shape::{self, Renderer}, util::animation_disabled, @@ -180,6 +179,8 @@ impl Component for Loader { } else { #[cfg(feature = "haptic")] { + use crate::ui::lerp::Lerp; + if matches!(self.state, State::Growing(_)) { let progress = self.progress(now).unwrap() as f32 / display::LOADER_MAX as f32; diff --git a/core/embed/rust/src/ui/model_tt/layout.rs b/core/embed/rust/src/ui/model_tt/layout.rs index 3dc60a6e6..bf09daf3a 100644 --- a/core/embed/rust/src/ui/model_tt/layout.rs +++ b/core/embed/rust/src/ui/model_tt/layout.rs @@ -549,7 +549,7 @@ extern "C" fn new_confirm_address(n_args: usize, args: *const Obj, kwargs: *mut let title: TString = kwargs.get(Qstr::MP_QSTR_title)?.try_into()?; let description: Option = kwargs.get(Qstr::MP_QSTR_description)?.try_into_option()?; - let verb: TString = kwargs.get_or(Qstr::MP_QSTR_verb, TR::buttons__confirm.try_into()?)?; + let verb: TString = kwargs.get_or(Qstr::MP_QSTR_verb, TR::buttons__confirm.into())?; let extra: Option = kwargs.get(Qstr::MP_QSTR_extra)?.try_into_option()?; let data: Obj = kwargs.get(Qstr::MP_QSTR_data)?; let chunkify: bool = kwargs.get_or(Qstr::MP_QSTR_chunkify, false)?; @@ -887,7 +887,7 @@ fn new_show_modal( let title: TString = kwargs.get(Qstr::MP_QSTR_title)?.try_into()?; let value: TString = kwargs.get_or(Qstr::MP_QSTR_value, "".into())?; let description: TString = kwargs.get_or(Qstr::MP_QSTR_description, "".into())?; - let button: TString = kwargs.get_or(Qstr::MP_QSTR_button, TR::buttons__continue.try_into()?)?; + let button: TString = kwargs.get_or(Qstr::MP_QSTR_button, TR::buttons__continue.into())?; let allow_cancel: bool = kwargs.get_or(Qstr::MP_QSTR_allow_cancel, true)?; let time_ms: u32 = kwargs.get_or(Qstr::MP_QSTR_time_ms, 0)?; @@ -1038,9 +1038,9 @@ extern "C" fn new_show_info(n_args: usize, args: *const Obj, kwargs: *mut Map) - extern "C" fn new_show_mismatch(n_args: usize, args: *const Obj, kwargs: *mut Map) -> Obj { let block = move |_args: &[Obj], kwargs: &Map| { let title: TString = kwargs.get(Qstr::MP_QSTR_title)?.try_into()?; - let description: TString = TR::addr_mismatch__contact_support_at.try_into()?; - let url: TString = TR::addr_mismatch__support_url.try_into()?; - let button: TString = TR::buttons__quit.try_into()?; + let description: TString = TR::addr_mismatch__contact_support_at.into(); + let url: TString = TR::addr_mismatch__support_url.into(); + let button: TString = TR::buttons__quit.into(); let icon = BlendedImage::new( theme::IMAGE_BG_OCTAGON, @@ -1387,9 +1387,9 @@ extern "C" fn new_confirm_recovery(n_args: usize, args: *const Obj, kwargs: *mut .with_spacing(theme::RECOVERY_SPACING); let notification: TString = if dry_run { - TR::recovery__title_dry_run.try_into()? + TR::recovery__title_dry_run.into() } else { - TR::recovery__title.try_into()? + TR::recovery__title.into() }; let obj = if info_button { @@ -1420,9 +1420,9 @@ extern "C" fn new_select_word_count(n_args: usize, args: *const Obj, kwargs: *mu let block = move |_args: &[Obj], kwargs: &Map| { let dry_run: bool = kwargs.get(Qstr::MP_QSTR_dry_run)?.try_into()?; let title: TString = if dry_run { - TR::recovery__title_dry_run.try_into()? + TR::recovery__title_dry_run.into() } else { - TR::recovery__title.try_into()? + TR::recovery__title.into() }; let paragraphs = Paragraphs::new(Paragraph::new(