diff --git a/core/embed/rust/src/ui/model_tt/component/homescreen/mod.rs b/core/embed/rust/src/ui/model_tt/component/homescreen/mod.rs index e872bf40b..39d07d4c6 100644 --- a/core/embed/rust/src/ui/model_tt/component/homescreen/mod.rs +++ b/core/embed/rust/src/ui/model_tt/component/homescreen/mod.rs @@ -16,11 +16,9 @@ use crate::{ use render::{ homescreen, homescreen_blurred, HomescreenNotification, HomescreenText, HOMESCREEN_IMAGE_SIZE, - HOMESCREEN_MAX_TEXTS, }; use crate::{trezorhal::display::ToifFormat, ui::display::toif_info}; -use heapless::Vec; use super::{theme, Loader, LoaderMsg}; @@ -188,13 +186,12 @@ where let mut label_style = theme::TEXT_BOLD; label_style.text_color = theme::FG; - let texts: Vec = - unwrap!(Vec::from_slice(&[HomescreenText { - text: self.label.as_ref(), - style: label_style, - offset: Offset::new(10, LABEL_Y), - icon: None - }],)); + let text = HomescreenText { + text: self.label.as_ref(), + style: label_style, + offset: Offset::new(10, LABEL_Y), + icon: None, + }; let notification = self.get_notification(); @@ -202,14 +199,14 @@ where if let Ok(data) = res { homescreen( data.as_ref(), - texts, + &[text], notification, self.paint_notification_only, ); } else { homescreen( IMAGE_HOMESCREEN, - texts, + &[text], notification, self.paint_notification_only, ); @@ -273,32 +270,32 @@ where let mut label_style = theme::TEXT_BOLD; label_style.text_color = theme::GREY_MEDIUM; - let texts: Vec = unwrap!(Vec::from_slice(&[ + let texts: [HomescreenText; 3] = [ HomescreenText { text: locked, style: theme::TEXT_BOLD, offset: Offset::new(10, LOCKED_Y), - icon: Some(theme::ICON_LOCK) + icon: Some(theme::ICON_LOCK), }, HomescreenText { text: tap, style: tap_style, offset: Offset::new(10, TAP_Y), - icon: None + icon: None, }, HomescreenText { text: self.label.as_ref(), style: label_style, offset: Offset::new(10, LABEL_Y), - icon: None + icon: None, }, - ],)); + ]; let res = get_image(); if let Ok(data) = res { - homescreen_blurred(data.as_ref(), texts); + homescreen_blurred(data.as_ref(), &texts); } else { - homescreen_blurred(IMAGE_HOMESCREEN, texts); + homescreen_blurred(IMAGE_HOMESCREEN, &texts); } } } diff --git a/core/embed/rust/src/ui/model_tt/component/homescreen/render.rs b/core/embed/rust/src/ui/model_tt/component/homescreen/render.rs index 60b7481fe..899c52589 100644 --- a/core/embed/rust/src/ui/model_tt/component/homescreen/render.rs +++ b/core/embed/rust/src/ui/model_tt/component/homescreen/render.rs @@ -15,7 +15,6 @@ use crate::{ geometry::{Offset, Point, Rect}, }, }; -use heapless::Vec; use crate::ui::{ component::text::TextStyle, @@ -47,7 +46,6 @@ struct HomescreenTextInfo { pub icon_area: Option, } -pub const HOMESCREEN_MAX_TEXTS: usize = 4; pub const HOMESCREEN_IMAGE_SIZE: i16 = 120; const HOMESCREEN_MAX_ICON_SIZE: i16 = 20; @@ -271,7 +269,7 @@ fn homescreen_line( } fn homescreen_next_text( - texts: &Vec, + texts: &[HomescreenText], text_buffer: &mut BufferText, icon_data: &mut [u8], text_info: HomescreenTextInfo, @@ -380,7 +378,7 @@ fn vertical_avg( } } -pub fn homescreen_blurred(data: &[u8], texts: Vec) { +pub fn homescreen_blurred(data: &[u8], texts: &[HomescreenText]) { let mut icon_data = [0_u8; (HOMESCREEN_MAX_ICON_SIZE * HOMESCREEN_MAX_ICON_SIZE / 2) as usize]; let text_buffer = unsafe { get_text_buffer(0, true) }; @@ -501,7 +499,7 @@ pub fn homescreen_blurred(data: &[u8], texts: Vec, + texts: &[HomescreenText], notification: Option, notification_only: bool, ) {