1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-25 16:08:32 +00:00

fixup! feat(core): integration of background image into homescreen

This commit is contained in:
tychovrahe 2022-11-19 22:12:05 +01:00
parent 8555ccaa92
commit ebcfdd38c5

View File

@ -71,10 +71,18 @@ where
fn get_notification(&self) -> Option<HomescreenNotification> { fn get_notification(&self) -> Option<HomescreenNotification> {
if !usb_configured() { if !usb_configured() {
let (color, icon) = Self::level_to_style(0); let (color, icon) = Self::level_to_style(0);
Some(("NO USB CONNECTION", icon, color)) Some(HomescreenNotification {
text: "NO USB CONNECTION",
icon,
color,
})
} else if let Some((notification, level)) = &self.notification { } else if let Some((notification, level)) = &self.notification {
let (color, icon) = Self::level_to_style(*level); let (color, icon) = Self::level_to_style(*level);
Some((notification.as_ref(), icon, color)) Some(HomescreenNotification {
text: notification.as_ref(),
icon,
color,
})
} else { } else {
None None
} }
@ -176,17 +184,12 @@ where
let mut label_style = theme::TEXT_BOLD; let mut label_style = theme::TEXT_BOLD;
label_style.text_color = theme::FG; label_style.text_color = theme::FG;
let texts: Vec<Option<HomescreenText>, 4> = unwrap!(Vec::from_slice(&[ let texts: Vec<HomescreenText, 4> = unwrap!(Vec::from_slice(&[HomescreenText {
Some(( text: self.label.as_ref(),
self.label.as_ref(), style: label_style,
label_style, offset: Offset::new(10, LABEL_Y),
Offset::new(10, LABEL_Y), icon: None
None }],));
)),
None,
None,
None,
],));
let notification = self.get_notification(); let notification = self.get_notification();
@ -255,21 +258,25 @@ where
let mut label_style = theme::TEXT_BOLD; let mut label_style = theme::TEXT_BOLD;
label_style.text_color = theme::GREY_MEDIUM; label_style.text_color = theme::GREY_MEDIUM;
let texts: Vec<Option<HomescreenText>, 4> = unwrap!(Vec::from_slice(&[ let texts: Vec<HomescreenText, 4> = unwrap!(Vec::from_slice(&[
Some(( HomescreenText {
locked, text: locked,
theme::TEXT_BOLD, style: theme::TEXT_BOLD,
Offset::new(10, LOCKED_Y), offset: Offset::new(10, LOCKED_Y),
Some(theme::ICON_LOCK) icon: Some(theme::ICON_LOCK)
)), },
Some((tap, tap_style, Offset::new(10, TAP_Y), None)), HomescreenText {
Some(( text: tap,
self.label.as_ref(), style: tap_style,
label_style, offset: Offset::new(10, TAP_Y),
Offset::new(10, LABEL_Y), icon: None
None },
)), HomescreenText {
None, text: self.label.as_ref(),
style: label_style,
offset: Offset::new(10, LABEL_Y),
icon: None
},
],)); ],));
homescreen_blurred(get_image(), texts); homescreen_blurred(get_image(), texts);
} }