1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-01 10:20:59 +00:00

refactor(core): consistent naming of UI layouts

- follow-up on 862c987779
- layout_bolt stays the same
- layout_samson -> layout_caesar
- layout_quicksilver -> layout_delizia
- use super for importing rust modules in layout code

[no changelog]
This commit is contained in:
obrusvit 2025-01-17 13:04:11 +01:00 committed by Vít Obrusník
parent 30e88f4641
commit 00740b560c
367 changed files with 1009 additions and 986 deletions

View File

@ -40,7 +40,7 @@ message DebugLinkDecision {
}
/**
* Structure representing button presses of UI samson
* Structure representing button presses of UI Caesar
*/
// TODO: probably delete the middle_btn as it is not a physical one
enum DebugPhysicalButton {

View File

@ -57,15 +57,15 @@ LAYOUT_FEATURE = layout_bolt
else ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),T2B1))
MCU = STM32F4
OPENOCD_TARGET = target/stm32f4x.cfg
LAYOUT_FEATURE = layout_samson
LAYOUT_FEATURE = layout_caesar
else ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),T3T1))
MCU = STM32U5
OPENOCD_TARGET = target/stm32u5x.cfg
LAYOUT_FEATURE = layout_quicksilver
LAYOUT_FEATURE = layout_delizia
else ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),T3B1))
MCU = STM32U5
OPENOCD_TARGET = target/stm32u5x.cfg
LAYOUT_FEATURE = layout_samson
LAYOUT_FEATURE = layout_caesar
else ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),T3W1))
MCU = STM32U5
OPENOCD_TARGET = target/stm32u5x.cfg

View File

@ -9,8 +9,8 @@ build = "build.rs"
default = ["layout_bolt"]
crypto = ["zeroize"]
layout_bolt = ["jpeg"]
layout_samson = []
layout_quicksilver = ["jpeg", "dma2d"]
layout_caesar = []
layout_delizia = ["jpeg", "dma2d"]
micropython = []
protobuf = ["micropython"]
ui = []

View File

@ -68,7 +68,7 @@ const DEFAULT_BINDGEN_MACROS_T2T1: &[&str] = &[
#[cfg(not(feature = "layout_bolt"))]
const DEFAULT_BINDGEN_MACROS_T2T1: &[&str] = &[];
#[cfg(feature = "layout_samson")]
#[cfg(feature = "layout_caesar")]
const DEFAULT_BINDGEN_MACROS_T2B1: &[&str] = &[
"-DSTM32F427",
"-DTREZOR_MODEL_T2B1",
@ -78,10 +78,10 @@ const DEFAULT_BINDGEN_MACROS_T2B1: &[&str] = &[
"-DDISPLAY_RESY=64",
"-DTREZOR_BOARD=\"T2B1/boards/t2b1-unix.h\"",
];
#[cfg(not(feature = "layout_samson"))]
#[cfg(not(feature = "layout_caesar"))]
const DEFAULT_BINDGEN_MACROS_T2B1: &[&str] = &[];
#[cfg(feature = "layout_quicksilver")]
#[cfg(feature = "layout_delizia")]
const DEFAULT_BINDGEN_MACROS_T3T1: &[&str] = &[
"-DSTM32U5",
"-DTREZOR_MODEL_T3T1",
@ -91,7 +91,7 @@ const DEFAULT_BINDGEN_MACROS_T3T1: &[&str] = &[
"-DDISPLAY_RESY=240",
"-DTREZOR_BOARD=\"T3T1/boards/t3t1-unix.h\"",
];
#[cfg(not(feature = "layout_quicksilver"))]
#[cfg(not(feature = "layout_delizia"))]
const DEFAULT_BINDGEN_MACROS_T3T1: &[&str] = &[];
fn add_bindgen_macros<'a>(clang_args: &mut Vec<&'a str>, envvar: Option<&'a str>) {

View File

@ -649,7 +649,7 @@ static void _librust_qstrs(void) {
MP_QSTR_show_progress_coinjoin;
MP_QSTR_show_remaining_shares;
MP_QSTR_show_share_words;
MP_QSTR_show_share_words_quicksilver;
MP_QSTR_show_share_words_delizia;
MP_QSTR_show_simple;
MP_QSTR_show_success;
MP_QSTR_show_wait_text;

View File

@ -927,7 +927,7 @@ extern "C" fn new_show_share_words(n_args: usize, args: *const Obj, kwargs: *mut
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
}
extern "C" fn new_show_share_words_quicksilver(
extern "C" fn new_show_share_words_delizia(
n_args: usize,
args: *const Obj,
kwargs: *mut Map,
@ -947,7 +947,7 @@ extern "C" fn new_show_share_words_quicksilver(
let words: Vec<TString, 33> = util::iter_into_vec(words)?;
let layout = ModelUI::show_share_words_quicksilver(
let layout = ModelUI::show_share_words_delizia(
words,
subtitle,
instructions,
@ -1280,7 +1280,7 @@ pub static mp_module_trezorui_api: Module = obj_module! {
/// items: Iterable[tuple[int, str | bytes]],
/// ) -> LayoutObj[UiResult]:
/// """Confirm long content with the possibility to go back from any page.
/// Meant to be used with confirm_with_info on UI bolt and samson."""
/// Meant to be used with confirm_with_info on UI Bolt and Caesar."""
Qstr::MP_QSTR_confirm_more => obj_fn_kw!(0, new_confirm_more).as_obj(),
/// def confirm_properties(
@ -1338,7 +1338,7 @@ pub static mp_module_trezorui_api: Module = obj_module! {
/// items: Iterable[tuple[int, str | bytes]],
/// ) -> LayoutObj[UiResult]:
/// """Confirm given items but with third button. Always single page
/// without scrolling. In Quicksilver, the button is placed in
/// without scrolling. In Delizia, the button is placed in
/// context menu."""
Qstr::MP_QSTR_confirm_with_info => obj_fn_kw!(0, new_confirm_with_info).as_obj(),
@ -1378,7 +1378,7 @@ pub static mp_module_trezorui_api: Module = obj_module! {
/// """Confirm the recipient, (optionally) confirm the amount and (optionally) confirm the summary and present a Hold to Sign page."""
Qstr::MP_QSTR_flow_confirm_output => obj_fn_kw!(0, new_flow_confirm_output).as_obj(),
// TODO: supply more arguments for Wipe code setting (quicksilver)
// TODO: supply more arguments for Wipe code setting (delizia)
///
/// def flow_confirm_set_new_pin(
/// *,
@ -1625,7 +1625,7 @@ pub static mp_module_trezorui_api: Module = obj_module! {
/// """Show mnemonic for backup."""
Qstr::MP_QSTR_show_share_words => obj_fn_kw!(0, new_show_share_words).as_obj(),
/// def show_share_words_quicksilver(
/// def show_share_words_delizia(
/// *,
/// words: Iterable[str],
/// subtitle: str | None,
@ -1635,7 +1635,7 @@ pub static mp_module_trezorui_api: Module = obj_module! {
/// ) -> LayoutObj[UiResult]:
/// """Show mnemonic for wallet backup preceded by an instruction screen and followed by a
/// confirmation screen."""
Qstr::MP_QSTR_show_share_words_quicksilver => obj_fn_kw!(0, new_show_share_words_quicksilver).as_obj(),
Qstr::MP_QSTR_show_share_words_delizia => obj_fn_kw!(0, new_show_share_words_delizia).as_obj(),
/// def show_simple(
/// *,
@ -1670,7 +1670,7 @@ pub static mp_module_trezorui_api: Module = obj_module! {
/// allow_cancel: bool = True,
/// danger: bool = False, # unused on bolt
/// ) -> LayoutObj[UiResult]:
/// """Warning modal. bolt: No buttons shown when `button` is empty string. samson: middle button and centered text."""
/// """Warning modal. Bolt: No buttons shown when `button` is empty string. Caesar: middle button and centered text."""
Qstr::MP_QSTR_show_warning => obj_fn_kw!(0, new_show_warning).as_obj(),
/// def tutorial() -> LayoutObj[UiResult]:

View File

@ -3,11 +3,11 @@
#[cfg(all(
feature = "layout_bolt",
not(feature = "layout_quicksilver"),
not(feature = "layout_samson")
not(feature = "layout_delizia"),
not(feature = "layout_caesar")
))]
pub use super::layout_bolt::constant::*;
#[cfg(all(feature = "layout_quicksilver", not(feature = "layout_bolt")))]
pub use super::layout_quicksilver::constant::*;
#[cfg(feature = "layout_samson")]
pub use super::layout_samson::constant::*;
#[cfg(all(feature = "layout_caesar", not(feature = "layout_delizia")))]
pub use super::layout_caesar::constant::*;
#[cfg(feature = "layout_delizia")]
pub use super::layout_delizia::constant::*;

View File

@ -5,18 +5,19 @@ use crate::{
constant::screen,
display::Icon,
geometry::{Alignment, Insets, Point, Rect},
layout_bolt::{
component::{Button, ButtonMsg::Clicked},
constant::WIDTH,
theme::bootloader::{
button_bld, button_bld_menu, text_title, BLD_BG, BUTTON_AREA_START, BUTTON_HEIGHT,
CONTENT_PADDING, CORNER_BUTTON_AREA, MENU32, TEXT_NORMAL, TEXT_WARNING, TITLE_AREA,
},
},
shape::Renderer,
},
};
use super::super::{
component::{Button, ButtonMsg::Clicked},
constant::WIDTH,
theme::bootloader::{
button_bld, button_bld_menu, text_title, BLD_BG, BUTTON_AREA_START, BUTTON_HEIGHT,
CONTENT_PADDING, CORNER_BUTTON_AREA, MENU32, TEXT_NORMAL, TEXT_WARNING, TITLE_AREA,
},
};
#[repr(u32)]
#[derive(Copy, Clone, ToPrimitive)]
pub enum IntroMsg {

View File

@ -5,18 +5,18 @@ use crate::{
constant::{screen, WIDTH},
display::Icon,
geometry::{Insets, Point, Rect},
layout_bolt::{
component::{Button, ButtonMsg::Clicked, IconText},
theme::bootloader::{
button_bld, button_bld_menu, text_title, BLD_BG, BUTTON_HEIGHT, CONTENT_PADDING,
CORNER_BUTTON_AREA, CORNER_BUTTON_TOUCH_EXPANSION, FIRE24, REFRESH24, TITLE_AREA,
X32,
},
},
shape::Renderer,
},
};
use super::super::{
component::{Button, ButtonMsg::Clicked, IconText},
theme::bootloader::{
button_bld, button_bld_menu, text_title, BLD_BG, BUTTON_HEIGHT, CONTENT_PADDING,
CORNER_BUTTON_AREA, CORNER_BUTTON_TOUCH_EXPANSION, FIRE24, REFRESH24, TITLE_AREA, X32,
},
};
const BUTTON_AREA_START: i16 = 56;
const BUTTON_SPACING: i16 = 8;

View File

@ -3,14 +3,15 @@ use crate::ui::{
constant::screen,
display::{toif::Toif, Font},
geometry::{Alignment, Alignment2D, Offset, Rect},
layout_bolt::theme::{
bootloader::{START_URL, WELCOME_COLOR},
GREY_MEDIUM, WHITE,
},
shape,
shape::Renderer,
};
use super::super::theme::{
bootloader::{START_URL, WELCOME_COLOR},
GREY_MEDIUM, WHITE,
};
pub struct Welcome {
bg: Pad,
}

View File

@ -6,23 +6,27 @@ use crate::{
constant::screen,
display::{Color, Icon},
geometry::{Alignment2D, Insets, Offset, Point, Rect},
layout_bolt::{
component::{Button, ButtonMsg::Clicked, ButtonStyleSheet},
constant::WIDTH,
theme::{
bootloader::{
text_fingerprint, text_title, BUTTON_AREA_START, BUTTON_HEIGHT,
CONTENT_PADDING, CORNER_BUTTON_AREA, CORNER_BUTTON_TOUCH_EXPANSION, INFO32,
TITLE_AREA, X32,
},
WHITE,
},
},
shape,
shape::Renderer,
},
};
use super::{
super::{
constant::WIDTH,
theme::{
bootloader::{
text_fingerprint, text_title, BUTTON_AREA_START, BUTTON_HEIGHT, CONTENT_PADDING,
CORNER_BUTTON_AREA, CORNER_BUTTON_TOUCH_EXPANSION, INFO32, TITLE_AREA, X32,
},
WHITE,
},
},
Button,
ButtonMsg::Clicked,
ButtonStyleSheet,
};
const ICON_TOP: i16 = 17;
const CONTENT_START: i16 = 72;

View File

@ -9,10 +9,14 @@ use crate::{
},
};
use crate::ui::layout_bolt::{
component::{ResultFooter, ResultStyle},
constant::WIDTH,
theme::{FATAL_ERROR_COLOR, ICON_WARNING40, RESULT_FOOTER_START, RESULT_PADDING, WHITE},
use super::{
super::{
constant::WIDTH,
theme::{
self, FATAL_ERROR_COLOR, ICON_WARNING40, RESULT_FOOTER_START, RESULT_PADDING, WHITE,
},
},
ResultFooter, ResultStyle,
};
const ICON_TOP: i16 = 23;
@ -20,9 +24,9 @@ const TITLE_AREA_START: i16 = 70;
const MESSAGE_AREA_START: i16 = 116;
#[cfg(feature = "bootloader")]
const STYLE: &ResultStyle = &crate::ui::layout_bolt::theme::bootloader::RESULT_WIPE;
const STYLE: &ResultStyle = &theme::bootloader::RESULT_WIPE;
#[cfg(not(feature = "bootloader"))]
const STYLE: &ResultStyle = &super::theme::RESULT_ERROR;
const STYLE: &ResultStyle = &theme::RESULT_ERROR;
pub struct ErrorScreen<'a> {
bg: Pad,

View File

@ -4,17 +4,17 @@ use crate::{
component::{image::Image, Child, Component, Event, EventCtx, Label},
display,
geometry::{Insets, Rect},
layout_bolt::component::{
fido_icons::get_fido_icon_data,
swipe::{Swipe, SwipeDirection},
theme, ScrollBar,
},
shape,
shape::Renderer,
},
};
use super::CancelConfirmMsg;
use super::{
fido_icons::get_fido_icon_data,
swipe::{Swipe, SwipeDirection},
theme, CancelConfirmMsg, ScrollBar,
};
use core::cell::Cell;
const ICON_HEIGHT: i16 = 70;

View File

@ -7,11 +7,12 @@ use crate::{
},
display::Icon,
geometry::{Alignment, Insets, Offset, Rect},
layout_bolt::component::{Button, ButtonMsg, CancelInfoConfirmMsg},
shape::Renderer,
},
};
use super::{Button, ButtonMsg, CancelInfoConfirmMsg};
pub struct Frame<T> {
border: Insets,
title: Child<Label<'static>>,

View File

@ -14,14 +14,16 @@ use crate::{
event::TouchEvent,
geometry::{Alignment, Alignment2D, Insets, Offset, Point, Rect},
layout::util::get_user_custom_image,
layout_bolt::{constant, theme::IMAGE_HOMESCREEN},
shape::{self, Renderer},
},
};
use crate::ui::constant::{HEIGHT, WIDTH};
use super::{theme, Loader, LoaderMsg};
use super::{
super::{constant, theme::IMAGE_HOMESCREEN},
theme, Loader, LoaderMsg,
};
const AREA: Rect = constant::screen();
const TOP_CENTER: Point = AREA.top_center();

View File

@ -3,21 +3,20 @@ use crate::{
ui::{
component::{text::common::TextBox, Component, Event, EventCtx},
geometry::{Alignment2D, Offset, Rect},
layout_bolt::{
component::{
keyboard::{
common::{render_pending_marker, MultiTapKeyboard},
mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT},
},
Button, ButtonContent, ButtonMsg,
},
theme,
},
shape,
shape::Renderer,
},
};
use super::super::{
super::theme,
keyboard::{
common::{render_pending_marker, MultiTapKeyboard},
mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT},
},
Button, ButtonContent, ButtonMsg,
};
const MAX_LENGTH: usize = 8;
pub struct Bip39Input {

View File

@ -3,14 +3,12 @@ use crate::{
ui::{
component::{Child, Component, Event, EventCtx, Label, Maybe},
geometry::{Alignment2D, Grid, Offset, Rect},
layout_bolt::{
component::{Button, ButtonMsg, Swipe, SwipeDirection},
theme,
},
shape::Renderer,
},
};
use super::super::{super::theme, Button, ButtonMsg, Swipe, SwipeDirection};
pub const MNEMONIC_KEY_COUNT: usize = 9;
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]

View File

@ -6,18 +6,19 @@ use crate::{
},
display,
geometry::{Grid, Offset, Rect},
layout_bolt::component::{
button::{Button, ButtonContent, ButtonMsg},
keyboard::common::{render_pending_marker, MultiTapKeyboard},
swipe::{Swipe, SwipeDirection},
theme, ScrollBar,
},
shape,
shape::Renderer,
util::long_line_content_with_ellipsis,
},
};
use super::super::{
button::{Button, ButtonContent, ButtonMsg},
keyboard::common::{render_pending_marker, MultiTapKeyboard},
swipe::{Swipe, SwipeDirection},
theme, ScrollBar,
};
use core::cell::Cell;
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]

View File

@ -12,17 +12,18 @@ use crate::{
display::Font,
event::TouchEvent,
geometry::{Alignment, Alignment2D, Grid, Insets, Offset, Rect},
layout_bolt::component::{
button::{
Button, ButtonContent,
ButtonMsg::{self, Clicked},
},
theme,
},
shape::{self, Renderer},
},
};
use super::super::{
button::{
Button, ButtonContent,
ButtonMsg::{self, Clicked},
},
theme,
};
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum PinKeyboardMsg {
Confirmed,

View File

@ -9,21 +9,20 @@ use crate::{
Component, Event, EventCtx,
},
geometry::{Alignment2D, Offset, Rect},
layout_bolt::{
component::{
keyboard::{
common::{render_pending_marker, MultiTapKeyboard},
mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT},
},
Button, ButtonContent, ButtonMsg,
},
theme,
},
shape::{self, Renderer},
util::ResultExt,
},
};
use super::super::{
super::theme,
keyboard::{
common::{render_pending_marker, MultiTapKeyboard},
mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT},
},
Button, ButtonContent, ButtonMsg,
};
const MAX_LENGTH: usize = 8;
pub struct Slip39Input {

View File

@ -1,12 +1,14 @@
use crate::ui::{
component::{Component, Event, EventCtx},
geometry::{Grid, GridCellSpan, Rect},
layout_bolt::{
component::button::{Button, ButtonMsg},
theme,
},
shape::Renderer,
};
use super::super::{
super::theme,
button::{Button, ButtonMsg},
};
use heapless::Vec;
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]

View File

@ -11,12 +11,13 @@ use crate::{
component::{Component, Event, EventCtx, Pad},
display::{self, toif::Icon, Color, LOADER_MAX},
geometry::{Alignment2D, Offset, Rect},
layout_bolt::constant,
shape::{self, Renderer},
util::animation_disabled,
},
};
use super::super::constant;
const GROWING_DURATION_MS: u32 = 1000;
const SHRINKING_DURATION_MS: u32 = 500;

View File

@ -487,11 +487,10 @@ mod tests {
component::text::paragraphs::{Paragraph, Paragraphs},
event::TouchEvent,
geometry::Point,
layout_bolt::constant,
},
};
use super::*;
use super::{super::super::constant, *};
const SCREEN: Rect = constant::screen().inset(theme::borders());

View File

@ -15,12 +15,13 @@ use crate::{
},
display::{Font, LOADER_MAX},
geometry::{Insets, Offset, Rect},
layout_bolt::constant,
shape::Renderer,
util::animation_disabled,
},
};
use super::super::constant;
pub struct Progress {
title: Child<Label<'static>>,
value: u16,

View File

@ -5,15 +5,14 @@ use crate::{
constant::screen,
display::{Color, Font, Icon},
geometry::{Alignment2D, Insets, Offset, Point, Rect},
layout_bolt::theme::FG,
shape,
shape::Renderer,
},
};
use crate::ui::layout_bolt::{
use super::super::{
constant::WIDTH,
theme::{RESULT_FOOTER_START, RESULT_PADDING},
theme::{FG, RESULT_FOOTER_START, RESULT_PADDING},
};
const MESSAGE_AREA_START: i16 = 97;

View File

@ -4,10 +4,12 @@ use crate::{
component::{Component, Event, EventCtx, Never, Paginate},
display::Font,
geometry::{Offset, Rect},
layout_bolt::theme,
shape::{self, Renderer},
},
};
use super::super::theme;
use heapless::Vec;
use ufmt::uwrite;

View File

@ -3,10 +3,11 @@ use crate::ui::{
display,
event::TouchEvent,
geometry::{Point, Rect},
layout_bolt::theme::backlight,
shape::Renderer,
};
use super::super::theme::backlight;
pub enum SwipeDirection {
Up,
Down,

View File

@ -1,12 +1,15 @@
use crate::ui::{
component::{Component, Event, EventCtx, Never},
geometry::{Alignment2D, Offset, Rect},
layout_bolt::theme,
shape,
shape::Renderer,
};
use super::theme;
#[cfg(feature = "bootloader")]
use crate::ui::{display::toif::Toif, layout_bolt::theme::bootloader::DEVICE_NAME};
use super::theme::bootloader::DEVICE_NAME;
#[cfg(feature = "bootloader")]
use crate::ui::display::toif::Toif;
const TEXT_BOTTOM_MARGIN: i16 = 24; // matching the homescreen label margin
const ICON_TOP_MARGIN: i16 = 48;

View File

@ -7,16 +7,15 @@ pub mod constant;
pub mod theme;
#[cfg(feature = "backlight")]
use crate::ui::layout_bolt::theme::backlight;
use theme::backlight;
#[cfg(feature = "micropython")]
pub mod component_msg_obj;
pub mod cshape;
use crate::ui::{
layout::simplified::show,
layout_bolt::component::{ErrorScreen, WelcomeScreen},
};
use crate::ui::layout::simplified::show;
use component::{ErrorScreen, WelcomeScreen};
pub struct UIBolt;

View File

@ -3,13 +3,14 @@ use crate::ui::{
constant::{HEIGHT, WIDTH},
display::{Color, Font},
geometry::{Offset, Point, Rect},
layout_bolt::{
component::{ButtonStyle, ButtonStyleSheet, ResultStyle},
theme::{BLACK, FG, GREY_DARK, GREY_LIGHT, WHITE},
},
util::include_res,
};
use super::super::{
component::{ButtonStyle, ButtonStyleSheet, ResultStyle},
theme::{BLACK, FG, GREY_DARK, GREY_LIGHT, WHITE},
};
pub const BLD_BG: Color = Color::rgb(0x00, 0x1E, 0xAD);
pub const BLD_FG: Color = WHITE;
pub const BLD_WIPE_COLOR: Color = Color::rgb(0xE7, 0x0E, 0x0E);

View File

@ -1024,7 +1024,7 @@ impl FirmwareUI for UIBolt {
Ok(layout)
}
fn show_share_words_quicksilver(
fn show_share_words_delizia(
_words: heapless::Vec<TString<'static>, 33>,
_subtitle: Option<TString<'static>>,
_instructions: Obj,
@ -1330,11 +1330,10 @@ mod tests {
ui::{
component::{text::op::OpTextLayout, Component},
geometry::Rect,
layout_bolt::constant,
},
};
use super::*;
use super::{super::constant, *};
const SCREEN: Rect = constant::screen().inset(theme::borders());

View File

@ -17,17 +17,15 @@ use super::{
bl_confirm::{Confirm, ConfirmMsg},
ResultScreen, WelcomeScreen,
},
cshape,
theme::{
bootloader::{BLD_BG, BLD_FG, ICON_ALERT, ICON_SPINNER, ICON_SUCCESS},
ICON_ARM_LEFT, ICON_ARM_RIGHT, TEXT_BOLD, TEXT_NORMAL,
},
UISamson,
UICaesar,
};
use crate::ui::{
display::toif::Toif, geometry::Alignment, layout_samson::cshape, shape,
shape::render_on_display,
};
use crate::ui::{display::toif::Toif, geometry::Alignment, shape, shape::render_on_display};
use ufmt::uwrite;
@ -48,7 +46,7 @@ impl ReturnToC for ConfirmMsg {
}
}
impl UISamson {
impl UICaesar {
fn screen_progress(
text: &str,
text2: &str,
@ -93,7 +91,7 @@ impl UISamson {
}
}
impl BootloaderUI for UISamson {
impl BootloaderUI for UICaesar {
fn screen_welcome() {
let mut frame = Welcome::new();
show(&mut frame, true);

View File

@ -11,14 +11,13 @@ use crate::{
},
display::Font,
geometry::{Alignment, Alignment2D, Insets, Offset, Rect},
layout_samson::cshape,
shape,
shape::Renderer,
util::animation_disabled,
},
};
use super::theme;
use super::super::{cshape, theme};
const FOOTER_TEXT_MARGIN: i16 = 8;
const LOADER_OFFSET: i16 = -15;

View File

@ -4,14 +4,13 @@ use crate::{
component::{Child, Component, Event, EventCtx, Label, Never, Pad},
constant::{screen, WIDTH},
geometry::{Alignment2D, Offset, Point, Rect},
layout_samson::cshape,
shape,
shape::Renderer,
},
};
use super::super::{
theme,
cshape, theme,
theme::{BG, FG, TITLE_AREA_HEIGHT},
};

View File

@ -11,14 +11,13 @@ use crate::{
constant,
display::{Font, Icon, LOADER_MAX},
geometry::{Alignment2D, Offset, Rect},
layout_samson::cshape,
shape,
shape::Renderer,
util::animation_disabled,
},
};
use super::super::theme;
use super::super::{cshape, theme};
const BOTTOM_DESCRIPTION_MARGIN: i16 = 10;
const LOADER_Y_OFFSET_TITLE: i16 = -10;

View File

@ -11,12 +11,12 @@ pub mod cshape;
mod screens;
pub mod theme;
pub struct UISamson {}
pub struct UICaesar {}
#[cfg(feature = "micropython")]
pub mod ui_firmware;
impl CommonUI for UISamson {
impl CommonUI for UICaesar {
const SCREEN: Rect = constant::SCREEN;
fn screen_fatal_error(title: &str, msg: &str, footer: &str) {

Some files were not shown because too many files have changed in this diff Show More