mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-24 07:28:34 +00:00
fix(eckhart): aligned screen border top arc
[no changelog]
This commit is contained in:
parent
5d3118f1ec
commit
2dfae34b39
@ -5,7 +5,10 @@ use crate::ui::{
|
||||
shape::{self, Renderer},
|
||||
};
|
||||
|
||||
use super::{super::theme, ScreenBorder};
|
||||
use super::{
|
||||
super::theme::{self, ICON_BORDER_BL, ICON_BORDER_BR},
|
||||
ScreenBorder,
|
||||
};
|
||||
|
||||
/// Renders the loader. Higher `progress` reveals the `border` from the top in
|
||||
/// clock-wise direction. Used in ProgressScreen and Bootloader. `progress` goes
|
||||
@ -119,7 +122,7 @@ fn get_progress_covers(progress_ratio: f32) -> impl Iterator<Item = Rect> {
|
||||
let width = ((1.0 - progress) * FULL_WIDTH as f32) as i16;
|
||||
Rect::snap(
|
||||
SCREEN.top_right(),
|
||||
Offset::new(width, theme::ICON_BORDER_TR.toif.height()),
|
||||
Offset::new(width, ScreenBorder::TOP_ARC_HEIGHT),
|
||||
Alignment2D::TOP_RIGHT,
|
||||
)
|
||||
};
|
||||
@ -132,7 +135,7 @@ fn get_progress_covers(progress_ratio: f32) -> impl Iterator<Item = Rect> {
|
||||
let height = ((1.0 - progress) * FULL_HEIGHT as f32) as i16;
|
||||
Rect::snap(
|
||||
SCREEN.bottom_right(),
|
||||
Offset::new(theme::ICON_BORDER_BR.toif.width(), height),
|
||||
Offset::new(ICON_BORDER_BR.toif.width(), height),
|
||||
Alignment2D::BOTTOM_RIGHT,
|
||||
)
|
||||
};
|
||||
@ -144,7 +147,7 @@ fn get_progress_covers(progress_ratio: f32) -> impl Iterator<Item = Rect> {
|
||||
let progress = ((progress_ratio - PROGRESS_START) / PROGRESS_PORTION).clamp(0.0, 1.0);
|
||||
let width = ((1.0 - progress) * FULL_WIDTH as f32) as i16;
|
||||
Rect::snap(
|
||||
SCREEN.bottom_left() + Offset::x(theme::ICON_BORDER_BL.toif.width()),
|
||||
SCREEN.bottom_left() + Offset::x(ICON_BORDER_BL.toif.width()),
|
||||
Offset::new(width, ScreenBorder::WIDTH),
|
||||
Alignment2D::BOTTOM_LEFT,
|
||||
)
|
||||
@ -157,8 +160,8 @@ fn get_progress_covers(progress_ratio: f32) -> impl Iterator<Item = Rect> {
|
||||
let progress = ((progress_ratio - PROGRESS_START) / PROGRESS_PORTION).clamp(0.0, 1.0);
|
||||
let height = ((1.0 - progress) * FULL_HEIGHT as f32) as i16;
|
||||
Rect::snap(
|
||||
SCREEN.top_left() + Offset::y(theme::ICON_BORDER_TL.toif.height()),
|
||||
Offset::new(theme::ICON_BORDER_BL.toif.width(), height),
|
||||
SCREEN.top_left() + Offset::y(ScreenBorder::TOP_ARC_HEIGHT),
|
||||
Offset::new(ICON_BORDER_BL.toif.width(), height),
|
||||
Alignment2D::TOP_LEFT,
|
||||
)
|
||||
};
|
||||
@ -171,7 +174,7 @@ fn get_progress_covers(progress_ratio: f32) -> impl Iterator<Item = Rect> {
|
||||
let width = ((1.0 - progress) * FULL_WIDTH as f32) as i16;
|
||||
Rect::snap(
|
||||
SCREEN.top_center(),
|
||||
Offset::new(width, theme::ICON_BORDER_TL.toif.height()),
|
||||
Offset::new(width, ScreenBorder::TOP_ARC_HEIGHT),
|
||||
Alignment2D::TOP_RIGHT,
|
||||
)
|
||||
};
|
||||
|
@ -6,29 +6,22 @@ use crate::ui::{
|
||||
|
||||
use super::super::{
|
||||
constant,
|
||||
theme::{ICON_BORDER_BL, ICON_BORDER_BR, ICON_BORDER_TL, ICON_BORDER_TR},
|
||||
theme::{ICON_BORDER_BL, ICON_BORDER_BR, ICON_BORDER_TOP},
|
||||
};
|
||||
|
||||
/// Custom shape for a full screen border overlay, parameterizable by color.
|
||||
pub struct ScreenBorder {
|
||||
color: Color,
|
||||
side_bars: [Rect; 4],
|
||||
side_bars: [Rect; 3],
|
||||
}
|
||||
|
||||
impl ScreenBorder {
|
||||
pub const WIDTH: i16 = 4;
|
||||
pub const TOP_ARC_HEIGHT: i16 = ICON_BORDER_TOP.toif.height();
|
||||
|
||||
pub const fn new(color: Color) -> Self {
|
||||
let screen = constant::screen();
|
||||
|
||||
// Top bar: from the right edge of top-left icon to the left edge of top-right
|
||||
// icon.
|
||||
let top_bar_rect = Rect {
|
||||
x0: screen.x0 + ICON_BORDER_TL.toif.width(),
|
||||
y0: screen.y0,
|
||||
x1: screen.x1 - ICON_BORDER_TR.toif.width(),
|
||||
y1: screen.y0 + Self::WIDTH,
|
||||
};
|
||||
|
||||
// Bottom bar: from the right edge of bottom-left icon to the left edge of
|
||||
// bottom-right icon.
|
||||
let bottom_bar_rect = Rect {
|
||||
@ -42,7 +35,7 @@ impl ScreenBorder {
|
||||
// bottom-left icon.
|
||||
let left_bar_rect = Rect {
|
||||
x0: screen.x0,
|
||||
y0: screen.y0 + ICON_BORDER_TL.toif.height(),
|
||||
y0: screen.y0 + Self::TOP_ARC_HEIGHT,
|
||||
x1: screen.x0 + Self::WIDTH,
|
||||
y1: screen.y1 - ICON_BORDER_BL.toif.height(),
|
||||
};
|
||||
@ -50,20 +43,16 @@ impl ScreenBorder {
|
||||
// bottom-right icon.
|
||||
let right_bar_rect = Rect {
|
||||
x0: screen.x1 - Self::WIDTH,
|
||||
y0: screen.y0 + ICON_BORDER_TR.toif.height(),
|
||||
y0: screen.y0 + Self::TOP_ARC_HEIGHT,
|
||||
x1: screen.x1,
|
||||
y1: screen.y1 - ICON_BORDER_BR.toif.height(),
|
||||
};
|
||||
Self {
|
||||
color,
|
||||
side_bars: [bottom_bar_rect, left_bar_rect, right_bar_rect, top_bar_rect],
|
||||
side_bars: [bottom_bar_rect, left_bar_rect, right_bar_rect],
|
||||
}
|
||||
}
|
||||
|
||||
pub fn bottom_width(&self) -> i16 {
|
||||
self.side_bars[0].width()
|
||||
}
|
||||
|
||||
pub fn render<'s>(&'s self, alpha: u8, target: &mut impl Renderer<'s>) {
|
||||
let screen = constant::screen();
|
||||
|
||||
@ -77,21 +66,16 @@ impl ScreenBorder {
|
||||
|
||||
// Draw the four corners.
|
||||
[
|
||||
(
|
||||
screen.top_left(),
|
||||
ICON_BORDER_TOP.toif,
|
||||
Alignment2D::TOP_LEFT,
|
||||
),
|
||||
(
|
||||
screen.bottom_left(),
|
||||
ICON_BORDER_BL.toif,
|
||||
Alignment2D::BOTTOM_LEFT,
|
||||
),
|
||||
(
|
||||
screen.top_right(),
|
||||
ICON_BORDER_TR.toif,
|
||||
Alignment2D::TOP_RIGHT,
|
||||
),
|
||||
(
|
||||
screen.top_left(),
|
||||
ICON_BORDER_TL.toif,
|
||||
Alignment2D::TOP_LEFT,
|
||||
),
|
||||
(
|
||||
screen.bottom_right(),
|
||||
ICON_BORDER_BR.toif,
|
||||
|
@ -229,7 +229,7 @@ impl HoldToConfirmAnim {
|
||||
);
|
||||
const TOP_GAP_FULL: Rect = Rect::from_center_and_size(
|
||||
SCREEN.top_center().ofs(Offset::y(ScreenBorder::WIDTH / 2)),
|
||||
Offset::new(SCREEN.width(), ScreenBorder::WIDTH),
|
||||
Offset::new(SCREEN.width(), ScreenBorder::TOP_ARC_HEIGHT),
|
||||
);
|
||||
match progress {
|
||||
// Bottom phase growing linearly
|
||||
@ -273,7 +273,7 @@ impl HoldToConfirmAnim {
|
||||
let width = i16::lerp(SCREEN.width(), 0, eased_progress);
|
||||
let top_gap = Rect::from_center_and_size(
|
||||
SCREEN.top_center().ofs(Offset::y(ScreenBorder::WIDTH / 2)),
|
||||
Offset::new(width, ScreenBorder::WIDTH),
|
||||
Offset::new(width, ScreenBorder::TOP_ARC_HEIGHT),
|
||||
);
|
||||
(SCREEN, top_gap)
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 263 B |
Binary file not shown.
BIN
core/embed/rust/src/ui/layout_eckhart/res/border/TOP.png
Normal file
BIN
core/embed/rust/src/ui/layout_eckhart/res/border/TOP.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 579 B |
BIN
core/embed/rust/src/ui/layout_eckhart/res/border/TOP.toif
Normal file
BIN
core/embed/rust/src/ui/layout_eckhart/res/border/TOP.toif
Normal file
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 245 B |
Binary file not shown.
@ -122,8 +122,7 @@ include_icon!(ICON_BATTERY_ZAP, "layout_eckhart/res/battery_zap.toif");
|
||||
// Border overlay icons for bootloader screens and hold to confirm animation
|
||||
include_icon!(ICON_BORDER_BL, "layout_eckhart/res/border/BL.toif");
|
||||
include_icon!(ICON_BORDER_BR, "layout_eckhart/res/border/BR.toif");
|
||||
include_icon!(ICON_BORDER_TL, "layout_eckhart/res/border/TL.toif");
|
||||
include_icon!(ICON_BORDER_TR, "layout_eckhart/res/border/TR.toif");
|
||||
include_icon!(ICON_BORDER_TOP, "layout_eckhart/res/border/TOP.toif");
|
||||
|
||||
// Icons for number input screen
|
||||
include_icon!(ICON_PLUS, "layout_eckhart/res/plus.toif");
|
||||
|
@ -29140,8 +29140,8 @@
|
||||
"T3W1_cs_test_basic.py::test_device_id_same": "a91b2ef93e22407126f6b154760efe9865c0eb94ca3ed8cd11c60815f8d845e4",
|
||||
"T3W1_cs_test_basic.py::test_features": "a91b2ef93e22407126f6b154760efe9865c0eb94ca3ed8cd11c60815f8d845e4",
|
||||
"T3W1_cs_test_basic.py::test_ping": "a91b2ef93e22407126f6b154760efe9865c0eb94ca3ed8cd11c60815f8d845e4",
|
||||
"T3W1_cs_test_busy_state.py::test_busy_expiry_core": "5ed51d9f9130ae99a251e712965da4dec75bd9230d6db4a2c8ff39e9051e20aa",
|
||||
"T3W1_cs_test_busy_state.py::test_busy_state": "aa82c3bea9525c48cf80efaf5dd06f377d3642380704b403ea5e88debeecac01",
|
||||
"T3W1_cs_test_busy_state.py::test_busy_expiry_core": "9a5a26a80481cfa3fb75a271cadb6db32e3af16495db85e8c64faba5c5be2a41",
|
||||
"T3W1_cs_test_busy_state.py::test_busy_state": "29b8163c8822a91885df40e5addbd3a476f7c4829af28d29b759030edbda56e0",
|
||||
"T3W1_cs_test_cancel.py::test_cancel_message_via_cancel[message0]": "b3729ec7e7d501f5fb2f2f3c19341d130b12a973856d7471cb518a28dc48d17c",
|
||||
"T3W1_cs_test_cancel.py::test_cancel_message_via_cancel[message1]": "a73d6439601e005ef1c0acd34e4359b22e1ef81830464740f0f77cf9173b7d90",
|
||||
"T3W1_cs_test_cancel.py::test_cancel_message_via_initialize[message0]": "b3729ec7e7d501f5fb2f2f3c19341d130b12a973856d7471cb518a28dc48d17c",
|
||||
@ -30556,8 +30556,8 @@
|
||||
"T3W1_de_test_basic.py::test_device_id_same": "c402aebce59d93f939380d41fc13fa05f99020f2f5ce4acbeb3ae8f58beabdc0",
|
||||
"T3W1_de_test_basic.py::test_features": "c402aebce59d93f939380d41fc13fa05f99020f2f5ce4acbeb3ae8f58beabdc0",
|
||||
"T3W1_de_test_basic.py::test_ping": "c402aebce59d93f939380d41fc13fa05f99020f2f5ce4acbeb3ae8f58beabdc0",
|
||||
"T3W1_de_test_busy_state.py::test_busy_expiry_core": "d5d0f5a79abed49244a4f60455c04da154fafa5131dfb3f7acda69a0d1e8b936",
|
||||
"T3W1_de_test_busy_state.py::test_busy_state": "03b677799db9a168233a30ff54d4b11b808ca38ccfaf3b6202615aa7684e88b8",
|
||||
"T3W1_de_test_busy_state.py::test_busy_expiry_core": "87460dca26e1b3724adc1ad89a2dfe9a5f2870a955e30a59dd67ad86181c7f86",
|
||||
"T3W1_de_test_busy_state.py::test_busy_state": "930733b22477d29709af7b20c04fb24b59a9a07a968abfb13367cebb76fdb3b2",
|
||||
"T3W1_de_test_cancel.py::test_cancel_message_via_cancel[message0]": "b4fe9ae162d5887708f0e7d9a87517dc0028cc63aa4589243107b0a8851f92dc",
|
||||
"T3W1_de_test_cancel.py::test_cancel_message_via_cancel[message1]": "17921f96d89feb086e81e9c18e58143c1d1ebb276c1d78c3f72afa955f80c9f6",
|
||||
"T3W1_de_test_cancel.py::test_cancel_message_via_initialize[message0]": "b4fe9ae162d5887708f0e7d9a87517dc0028cc63aa4589243107b0a8851f92dc",
|
||||
@ -31972,8 +31972,8 @@
|
||||
"T3W1_en_test_basic.py::test_device_id_same": "a5bf877c22babe3784771f360eeb5b2b8c448b17e12d0a915479f968247010ed",
|
||||
"T3W1_en_test_basic.py::test_features": "a5bf877c22babe3784771f360eeb5b2b8c448b17e12d0a915479f968247010ed",
|
||||
"T3W1_en_test_basic.py::test_ping": "a5bf877c22babe3784771f360eeb5b2b8c448b17e12d0a915479f968247010ed",
|
||||
"T3W1_en_test_busy_state.py::test_busy_expiry_core": "8da7c44ad816b06a46ced4cf729c8e0bb7c26126a1c5106d9d14cf96e9941c65",
|
||||
"T3W1_en_test_busy_state.py::test_busy_state": "cc2e8cb179b93f02e262655fcdfd372786d739e50b7a3556b42947c03f77f473",
|
||||
"T3W1_en_test_busy_state.py::test_busy_expiry_core": "a257b9882860b982820125a1e299ee3e27a1a76bd830cfec09bbbdb2cce591cd",
|
||||
"T3W1_en_test_busy_state.py::test_busy_state": "2b44e7073b958784479675e94c0df0fec99e503f7dae48a9980fc2c17358e1e0",
|
||||
"T3W1_en_test_cancel.py::test_cancel_message_via_cancel[message0]": "a95305c826c54f5f1883d4a87407516e38a1920cbafbc34ba3999d5c54e678d5",
|
||||
"T3W1_en_test_cancel.py::test_cancel_message_via_cancel[message1]": "2ebcaa46a75f3afc1dc2c9df42f54506d84909dcae2929a01c4de26ce5ae2e6e",
|
||||
"T3W1_en_test_cancel.py::test_cancel_message_via_initialize[message0]": "a95305c826c54f5f1883d4a87407516e38a1920cbafbc34ba3999d5c54e678d5",
|
||||
@ -33388,8 +33388,8 @@
|
||||
"T3W1_es_test_basic.py::test_device_id_same": "2889aea00f3e57b1977186660d1e15b1226507108c6a1a4cb625d6151f93002f",
|
||||
"T3W1_es_test_basic.py::test_features": "2889aea00f3e57b1977186660d1e15b1226507108c6a1a4cb625d6151f93002f",
|
||||
"T3W1_es_test_basic.py::test_ping": "2889aea00f3e57b1977186660d1e15b1226507108c6a1a4cb625d6151f93002f",
|
||||
"T3W1_es_test_busy_state.py::test_busy_expiry_core": "43314f21fcdfa5918513c6447928e0cf364012910fc07a042b611fae8fdaea81",
|
||||
"T3W1_es_test_busy_state.py::test_busy_state": "b263263e428a3c4e6adf9b1f87c38656b78b51c27b69627f0bdee55af4a12279",
|
||||
"T3W1_es_test_busy_state.py::test_busy_expiry_core": "d519f439625af68dc01550f8efba5b6daf8707cb336c69058134de1d8ab998a4",
|
||||
"T3W1_es_test_busy_state.py::test_busy_state": "19434db9e9ed5b69744a35e98f0ed18551eb397343708f59b75968129a1c74d3",
|
||||
"T3W1_es_test_cancel.py::test_cancel_message_via_cancel[message0]": "431ba6a2327769eafc31e5a8271be19c2435af437a9844f775b2d80fd5d08bcd",
|
||||
"T3W1_es_test_cancel.py::test_cancel_message_via_cancel[message1]": "cd807409d431dee3e4bb8a320c1516b63b12d2d8d3a44c8b54a8d4f1de22cc11",
|
||||
"T3W1_es_test_cancel.py::test_cancel_message_via_initialize[message0]": "431ba6a2327769eafc31e5a8271be19c2435af437a9844f775b2d80fd5d08bcd",
|
||||
@ -34804,8 +34804,8 @@
|
||||
"T3W1_fr_test_basic.py::test_device_id_same": "7dec10fe48983f7c9a0ab7ae5e70a7c414a657fe8466e229d5de59277c1174ee",
|
||||
"T3W1_fr_test_basic.py::test_features": "7dec10fe48983f7c9a0ab7ae5e70a7c414a657fe8466e229d5de59277c1174ee",
|
||||
"T3W1_fr_test_basic.py::test_ping": "7dec10fe48983f7c9a0ab7ae5e70a7c414a657fe8466e229d5de59277c1174ee",
|
||||
"T3W1_fr_test_busy_state.py::test_busy_expiry_core": "74ed76b2c0ed75b5d68cbd916b71a7709a4ebcc436a32c33b44433da1dfdb004",
|
||||
"T3W1_fr_test_busy_state.py::test_busy_state": "c3d99918d9631ec84f6172dc78c7a815e5d8cf45c1a02f842d45b46688d718e6",
|
||||
"T3W1_fr_test_busy_state.py::test_busy_expiry_core": "4ec0e9fd3f31a1f1ec00c6644ed99c68dbf18696ea3b2faefbac8a4840b60c7a",
|
||||
"T3W1_fr_test_busy_state.py::test_busy_state": "616122bd9653a1853405525684a4260f1a45fe9775076e124dc60b71eac9b5f7",
|
||||
"T3W1_fr_test_cancel.py::test_cancel_message_via_cancel[message0]": "1f178f36e387d983259337b49b5d82bed9281df89fcd37f6d424bf3b6dc66dea",
|
||||
"T3W1_fr_test_cancel.py::test_cancel_message_via_cancel[message1]": "f12cee5f9d7423d55c774be4cf4ff342d89278669335a3b07543777e940fdb37",
|
||||
"T3W1_fr_test_cancel.py::test_cancel_message_via_initialize[message0]": "1f178f36e387d983259337b49b5d82bed9281df89fcd37f6d424bf3b6dc66dea",
|
||||
@ -36220,8 +36220,8 @@
|
||||
"T3W1_pt_test_basic.py::test_device_id_same": "08ddbb6ef426932f807732f3aa7f7d5bac4f18858d97d60d98cdaedd9d365d1e",
|
||||
"T3W1_pt_test_basic.py::test_features": "08ddbb6ef426932f807732f3aa7f7d5bac4f18858d97d60d98cdaedd9d365d1e",
|
||||
"T3W1_pt_test_basic.py::test_ping": "08ddbb6ef426932f807732f3aa7f7d5bac4f18858d97d60d98cdaedd9d365d1e",
|
||||
"T3W1_pt_test_busy_state.py::test_busy_expiry_core": "469e1c78efa7d0175cfd8553929c6befec4c7c6b82202cf70a2370952e6e3fd7",
|
||||
"T3W1_pt_test_busy_state.py::test_busy_state": "a10dfb4e3ac15f32714aa02c5405b8368c7298d30429eedd5e8aa882a8010ab1",
|
||||
"T3W1_pt_test_busy_state.py::test_busy_expiry_core": "f1d7702e80b8125f2dc3777b47b9d8dbd2586c8b58b30047d0963a012abd1f9b",
|
||||
"T3W1_pt_test_busy_state.py::test_busy_state": "acfa170fcb6f1298dba00e1c2e771eb7ea0e457f12ec66db8bc5e456d425679d",
|
||||
"T3W1_pt_test_cancel.py::test_cancel_message_via_cancel[message0]": "935a54dc757d60a3ab7d072a4e91f54bc62f71b24f7197fe28962fac5df30379",
|
||||
"T3W1_pt_test_cancel.py::test_cancel_message_via_cancel[message1]": "a7421ebf27b5eb08b383769637ed6490a4210c95b9defb2b00467c1b3cc12883",
|
||||
"T3W1_pt_test_cancel.py::test_cancel_message_via_initialize[message0]": "935a54dc757d60a3ab7d072a4e91f54bc62f71b24f7197fe28962fac5df30379",
|
||||
|
Loading…
Reference in New Issue
Block a user