From 5258e9a30775f9059e6a1df737a8541da5ebcf24 Mon Sep 17 00:00:00 2001 From: grdddj Date: Mon, 5 Jun 2023 10:56:06 +0200 Subject: [PATCH] feat(core/rust): use icon for displaying device name in welcome screen [no changelog] --- core/assets/model_r/device_name.png | Bin 0 -> 7341 bytes .../src/ui/model_tr/component/welcome_screen.rs | 13 ++++--------- .../rust/src/ui/model_tr/res/device_name.toif | Bin 0 -> 139 bytes core/embed/rust/src/ui/model_tr/theme.rs | 5 +---- 4 files changed, 5 insertions(+), 13 deletions(-) create mode 100644 core/assets/model_r/device_name.png create mode 100644 core/embed/rust/src/ui/model_tr/res/device_name.toif diff --git a/core/assets/model_r/device_name.png b/core/assets/model_r/device_name.png new file mode 100644 index 0000000000000000000000000000000000000000..84cdebf5ec04d663c52805c79961e30c56810a37 GIT binary patch literal 7341 zcmeHKcTkgC)2B)kL{vm6#!xJf3Iq}e0RmE_7Xbk^q(CkNViE`-f)ooy1w;fzq$&17 zktR|^M0%Aj!lg(@iU=Zn59sykeDBORcjkNlyP0{C=j_@2o!#H=*~x}mm>CEQ?iS?W z;1D)4)UyJ9S->O44}5Vvak~8ikgxdL*t4t%Y!IE{MWK3-K`cKy8ASG_QaCt#yKW~q z$2&c^6xO#(e+#E5NJ0eX@+etnO9?K9+DAN&%ki@7v~@_-=uF|)4?}jWtt<+!y}lOL zqn<=q8tPSl%;R}~)si`sJBC%F|L936 z?q$##!-<#YfnBE~$)aPy!KG~;CLhh0LnjO^W;(|vPjkgxaI`~R;o;GS7@0!!>m01p zqNUF$I5t?#as}JCYk44d#%w}izdrJdyu+qGPR!(PkfneuN7Z>H3pYPCzBglV_&h$_ z7?S($NbYCMm`AhmgGZ_~XoR)?;l}%>wnZX0o&861^Bxy3HjPx_Me8tKjZJSPn2d(E z)mPZ&&;;g?{DX(Pk2n@C?{@e6m|gR@h}L`hGS*y+(RjJ#QgUErV*KWV4$uCmYb_MM zvGcyOKwgi3cU$*#{@lJlj@z$IeuY^aKHfTuuZFeW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r|i}y-+#R(8B{}$vvZkgxA=`QlZykO=cY>u5G)cXWiR~3*6 R2fXJn(l^t4ta~Ele*mJ#EQ$aC literal 0 HcmV?d00001 diff --git a/core/embed/rust/src/ui/model_tr/component/welcome_screen.rs b/core/embed/rust/src/ui/model_tr/component/welcome_screen.rs index f675584a7b..e497e81919 100644 --- a/core/embed/rust/src/ui/model_tr/component/welcome_screen.rs +++ b/core/embed/rust/src/ui/model_tr/component/welcome_screen.rs @@ -1,15 +1,11 @@ use crate::ui::{ component::{Component, Event, EventCtx, Never}, - constant::MODEL_NAME, - display, geometry::{self, Offset, Rect}, }; use super::super::theme; -const TEXT_BOTTOM_MARGIN: i16 = 2; // matching the homescreen label margin const ICON_TOP_MARGIN: i16 = 11; -const MODEL_NAME_FONT: display::Font = display::Font::NORMAL; pub struct WelcomeScreen { area: Rect, @@ -34,10 +30,9 @@ impl Component for WelcomeScreen { } fn paint(&mut self) { - display::text_center( - self.area.bottom_center() - Offset::y(TEXT_BOTTOM_MARGIN), - MODEL_NAME, - MODEL_NAME_FONT, + theme::ICON_DEVICE_NAME.draw( + self.area.bottom_center(), + geometry::BOTTOM_CENTER, theme::FG, theme::BG, ); @@ -54,6 +49,6 @@ impl Component for WelcomeScreen { impl crate::trace::Trace for WelcomeScreen { fn trace(&self, t: &mut dyn crate::trace::Tracer) { t.component("WelcomeScreen"); - t.string("model_name", MODEL_NAME); + t.string("model_name", "Trezor Model R"); } } diff --git a/core/embed/rust/src/ui/model_tr/res/device_name.toif b/core/embed/rust/src/ui/model_tr/res/device_name.toif new file mode 100644 index 0000000000000000000000000000000000000000..ab9bab67cbccf0d2afefe19ae90f4dee7e1b962d GIT binary patch literal 139 zcmV;60CfLUPf15~01^Oy0002pkBn;_7PhVtsW1cUh6-ikSN1%Ko tuXl1fNEBPhJfAtCWR}rL$;b9Xyp#AzLba1GKh(RT{nW0+TU(#^9|!hTKHmTU literal 0 HcmV?d00001 diff --git a/core/embed/rust/src/ui/model_tr/theme.rs b/core/embed/rust/src/ui/model_tr/theme.rs index 4d1befc84a..89092f196e 100644 --- a/core/embed/rust/src/ui/model_tr/theme.rs +++ b/core/embed/rust/src/ui/model_tr/theme.rs @@ -43,10 +43,6 @@ pub fn textstyle_number_bold_or_mono(num: i32) -> &'static TextStyle { } } -// BLD icons -include_icon!(LOGO_EMPTY, "model_tr/res/trezor_empty.toif"); -include_icon!(ICON_FAIL, "model_tr/res/fail.toif"); - // Firmware icons include_icon!(ICON_ARM_LEFT, "model_tr/res/arm_left.toif"); // 6*10 include_icon!(ICON_ARM_RIGHT, "model_tr/res/arm_right.toif"); // 6*10 @@ -71,6 +67,7 @@ include_icon!( empty_right_col = true ); // 8*8 include_icon!(ICON_DELETE, "model_tr/res/delete.toif"); // 10*7 +include_icon!(ICON_DEVICE_NAME, "model_tr/res/device_name.toif"); include_icon!(ICON_EYE, "model_tr/res/eye_round.toif"); // 12*7 include_icon!(ICON_LOCK, "model_tr/res/lock.toif"); // 10*10 include_icon!(ICON_LOGO, "model_tr/res/logo_22_33.toif"); // 22*33