From dba4bf9e385bbf0ea57310a097b0d12d0832f2e6 Mon Sep 17 00:00:00 2001 From: grdddj Date: Mon, 15 Jan 2024 12:47:50 +0100 Subject: [PATCH] feat(core): improve the design of TT locking loader on homescreen [no changelog] --- core/assets/lock24.png | Bin 0 -> 335 bytes .../src/ui/model_tt/component/homescreen/mod.rs | 8 ++++---- .../rust/src/ui/model_tt/component/loader.rs | 9 +++++++++ core/embed/rust/src/ui/model_tt/res/lock24.toif | Bin 0 -> 77 bytes core/embed/rust/src/ui/model_tt/theme/mod.rs | 16 ++++++++++++++++ 5 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 core/assets/lock24.png create mode 100644 core/embed/rust/src/ui/model_tt/res/lock24.toif diff --git a/core/assets/lock24.png b/core/assets/lock24.png new file mode 100644 index 0000000000000000000000000000000000000000..5c5b7673fdb9bc93dc669ee9152af19026c3ab6f GIT binary patch literal 335 zcmeAS@N?(olHy`uVBq!ia0vp^5kr_Wm>bfjrIvkH}&M z20djEW~^9hUj`IpFY)wsWq-lQ%*m@(m{O_-6p}1)jVN)>&&^HED`9XhN=+){|$l-jm4x*8Y|yKBB9mV@-6UUH!dFb^1H) z#P{9XcWQ&sbggFVa+_qW**j#8KFv_=4DOLuof9#mwS0y3(h061-EAi(WE?c_2oYVS z@QJrUckQ*DmU*tZ1e4F*qFKbLh*2~7Y(n0bx> literal 0 HcmV?d00001 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 a89345fef0..47922aa527 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 @@ -38,7 +38,7 @@ const TOP_CENTER: Point = AREA.top_center(); const LABEL_Y: i16 = HEIGHT - 18; const LOCKED_Y: i16 = HEIGHT / 2 - 13; const TAP_Y: i16 = HEIGHT / 2 + 14; -const HOLD_Y: i16 = 35; +const HOLD_Y: i16 = 200; const COINJOIN_Y: i16 = 30; const LOADER_OFFSET: Offset = Offset::y(-10); const LOADER_DELAY: Duration = Duration::from_millis(500); @@ -67,7 +67,7 @@ where label, notification, hold_to_lock, - loader: Loader::new().with_durations(LOADER_DURATION, LOADER_DURATION / 3), + loader: Loader::with_lock_icon().with_durations(LOADER_DURATION, LOADER_DURATION / 3), pad: Pad::with_background(theme::BG), paint_notification_only: false, delay: None, @@ -106,8 +106,8 @@ where fn paint_loader(&mut self) { display::text_center( TOP_CENTER + Offset::y(HOLD_Y), - "HOLD TO LOCK", - Font::BOLD, + "Locking the device...", + Font::NORMAL, theme::FG, theme::BG, ); 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 2f6b9d62d4..20eac60466 100644 --- a/core/embed/rust/src/ui/model_tt/component/loader.rs +++ b/core/embed/rust/src/ui/model_tt/component/loader.rs @@ -39,6 +39,15 @@ impl Loader { pub fn new() -> Self { let styles = theme::loader_default(); + Self::with_styles(styles) + } + + pub fn with_lock_icon() -> Self { + let styles = theme::loader_lock_icon(); + Self::with_styles(styles) + } + + pub fn with_styles(styles: LoaderStyleSheet) -> Self { Self { pad: Pad::with_background(styles.normal.background_color), state: State::Initial, diff --git a/core/embed/rust/src/ui/model_tt/res/lock24.toif b/core/embed/rust/src/ui/model_tt/res/lock24.toif new file mode 100644 index 0000000000000000000000000000000000000000..16b4c4600ff29ed112af4462b0e62b59afd8d82d GIT binary patch literal 77 zcmV-T0J8s7Pf14@02=^70001EU|?WqczchN0Sf;7|9_te!rbsbd)a>;2>VMv1H<=t j2>T~51H*;&5cV&i{DSjDvS0j%gT8 LoaderStyleSheet { } } +pub const fn loader_lock_icon() -> LoaderStyleSheet { + LoaderStyleSheet { + normal: &LoaderStyle { + icon: Some((ICON_LOCK_BIG, FG)), + loader_color: FG, + background_color: BG, + }, + active: &LoaderStyle { + icon: Some((ICON_LOCK_BIG, FG)), + loader_color: GREEN, + background_color: BG, + }, + } +} + pub const TEXT_NORMAL: TextStyle = TextStyle::new(Font::NORMAL, FG, BG, GREY_LIGHT, GREY_LIGHT); pub const TEXT_DEMIBOLD: TextStyle = TextStyle::new(Font::DEMIBOLD, FG, BG, GREY_LIGHT, GREY_LIGHT); pub const TEXT_BOLD: TextStyle = TextStyle::new(Font::BOLD, FG, BG, GREY_LIGHT, GREY_LIGHT);