mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-08-02 20:08:31 +00:00
fixup! feat(core): integrate new drawing library
This commit is contained in:
parent
0fb77b476a
commit
d57fc99bd4
@ -8,7 +8,11 @@ pub mod theme;
|
|||||||
|
|
||||||
#[cfg(feature = "micropython")]
|
#[cfg(feature = "micropython")]
|
||||||
pub mod layout;
|
pub mod layout;
|
||||||
mod screens;
|
|
||||||
|
use crate::ui::{
|
||||||
|
layout::simplified::show,
|
||||||
|
model_tt::component::{ErrorScreen, WelcomeScreen},
|
||||||
|
};
|
||||||
|
|
||||||
pub struct ModelTTFeatures;
|
pub struct ModelTTFeatures;
|
||||||
|
|
||||||
@ -31,10 +35,12 @@ impl UIFeaturesCommon for ModelTTFeatures {
|
|||||||
const SCREEN: Rect = constant::SCREEN;
|
const SCREEN: Rect = constant::SCREEN;
|
||||||
|
|
||||||
fn screen_fatal_error(title: &str, msg: &str, footer: &str) {
|
fn screen_fatal_error(title: &str, msg: &str, footer: &str) {
|
||||||
screens::screen_fatal_error(title, msg, footer);
|
let mut frame = ErrorScreen::new(title.into(), msg.into(), footer.into());
|
||||||
|
show(&mut frame, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn screen_boot_stage_2() {
|
fn screen_boot_stage_2() {
|
||||||
screens::screen_boot_stage_2();
|
let mut frame = WelcomeScreen::new(false);
|
||||||
|
show(&mut frame, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
use crate::ui::{
|
|
||||||
component::Component,
|
|
||||||
constant::screen,
|
|
||||||
display,
|
|
||||||
model_tt::{
|
|
||||||
component::{ErrorScreen, WelcomeScreen},
|
|
||||||
constant,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
#[cfg(feature = "new_rendering")]
|
|
||||||
use crate::ui::{display::Color, shape::render_on_display};
|
|
||||||
|
|
||||||
pub fn screen_fatal_error(title: &str, msg: &str, footer: &str) {
|
|
||||||
let mut frame = ErrorScreen::new(title.into(), msg.into(), footer.into());
|
|
||||||
frame.place(constant::screen());
|
|
||||||
|
|
||||||
#[cfg(feature = "new_rendering")]
|
|
||||||
render_on_display(None, Some(Color::black()), |target| {
|
|
||||||
frame.render(target);
|
|
||||||
});
|
|
||||||
|
|
||||||
#[cfg(not(feature = "new_rendering"))]
|
|
||||||
frame.paint();
|
|
||||||
display::refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn screen_boot_stage_2() {
|
|
||||||
let mut frame = WelcomeScreen::new(false);
|
|
||||||
frame.place(screen());
|
|
||||||
|
|
||||||
#[cfg(feature = "new_rendering")]
|
|
||||||
{
|
|
||||||
display::sync();
|
|
||||||
render_on_display(None, Some(Color::black()), |target| {
|
|
||||||
frame.render(target);
|
|
||||||
});
|
|
||||||
display::refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(not(feature = "new_rendering"))]
|
|
||||||
{
|
|
||||||
display::sync();
|
|
||||||
frame.paint();
|
|
||||||
display::refresh();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user