mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-08 14:31:06 +00:00
feat(core/rust): use icon for displaying device name in welcome screen
[no changelog]
This commit is contained in:
parent
88fd4cd11f
commit
5258e9a307
BIN
core/assets/model_r/device_name.png
Normal file
BIN
core/assets/model_r/device_name.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
@ -1,15 +1,11 @@
|
|||||||
use crate::ui::{
|
use crate::ui::{
|
||||||
component::{Component, Event, EventCtx, Never},
|
component::{Component, Event, EventCtx, Never},
|
||||||
constant::MODEL_NAME,
|
|
||||||
display,
|
|
||||||
geometry::{self, Offset, Rect},
|
geometry::{self, Offset, Rect},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::super::theme;
|
use super::super::theme;
|
||||||
|
|
||||||
const TEXT_BOTTOM_MARGIN: i16 = 2; // matching the homescreen label margin
|
|
||||||
const ICON_TOP_MARGIN: i16 = 11;
|
const ICON_TOP_MARGIN: i16 = 11;
|
||||||
const MODEL_NAME_FONT: display::Font = display::Font::NORMAL;
|
|
||||||
|
|
||||||
pub struct WelcomeScreen {
|
pub struct WelcomeScreen {
|
||||||
area: Rect,
|
area: Rect,
|
||||||
@ -34,10 +30,9 @@ impl Component for WelcomeScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn paint(&mut self) {
|
fn paint(&mut self) {
|
||||||
display::text_center(
|
theme::ICON_DEVICE_NAME.draw(
|
||||||
self.area.bottom_center() - Offset::y(TEXT_BOTTOM_MARGIN),
|
self.area.bottom_center(),
|
||||||
MODEL_NAME,
|
geometry::BOTTOM_CENTER,
|
||||||
MODEL_NAME_FONT,
|
|
||||||
theme::FG,
|
theme::FG,
|
||||||
theme::BG,
|
theme::BG,
|
||||||
);
|
);
|
||||||
@ -54,6 +49,6 @@ impl Component for WelcomeScreen {
|
|||||||
impl crate::trace::Trace for WelcomeScreen {
|
impl crate::trace::Trace for WelcomeScreen {
|
||||||
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
|
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
|
||||||
t.component("WelcomeScreen");
|
t.component("WelcomeScreen");
|
||||||
t.string("model_name", MODEL_NAME);
|
t.string("model_name", "Trezor Model R");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
core/embed/rust/src/ui/model_tr/res/device_name.toif
Normal file
BIN
core/embed/rust/src/ui/model_tr/res/device_name.toif
Normal file
Binary file not shown.
@ -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
|
// Firmware icons
|
||||||
include_icon!(ICON_ARM_LEFT, "model_tr/res/arm_left.toif"); // 6*10
|
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
|
include_icon!(ICON_ARM_RIGHT, "model_tr/res/arm_right.toif"); // 6*10
|
||||||
@ -71,6 +67,7 @@ include_icon!(
|
|||||||
empty_right_col = true
|
empty_right_col = true
|
||||||
); // 8*8
|
); // 8*8
|
||||||
include_icon!(ICON_DELETE, "model_tr/res/delete.toif"); // 10*7
|
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_EYE, "model_tr/res/eye_round.toif"); // 12*7
|
||||||
include_icon!(ICON_LOCK, "model_tr/res/lock.toif"); // 10*10
|
include_icon!(ICON_LOCK, "model_tr/res/lock.toif"); // 10*10
|
||||||
include_icon!(ICON_LOGO, "model_tr/res/logo_22_33.toif"); // 22*33
|
include_icon!(ICON_LOGO, "model_tr/res/logo_22_33.toif"); // 22*33
|
||||||
|
Loading…
Reference in New Issue
Block a user