1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-04 04:21:01 +00:00

feat(core/rust): use icon for displaying device name in welcome screen

[no changelog]
This commit is contained in:
grdddj 2023-06-05 10:56:06 +02:00 committed by Jiří Musil
parent 88fd4cd11f
commit 5258e9a307
4 changed files with 5 additions and 13 deletions
core
assets/model_r
embed/rust/src/ui/model_tr

Binary file not shown.

After

(image error) Size: 7.2 KiB

View File

@ -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");
}
}

Binary file not shown.

View File

@ -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