1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-06-26 09:52:34 +00:00

refactor(eckhart): separate FW comps and theme

This commit is contained in:
obrusvit 2025-02-20 13:58:57 +01:00 committed by Vít Obrusník
parent 72640f3518
commit 7a364fa215
37 changed files with 644 additions and 591 deletions

View File

@ -11,7 +11,8 @@ use crate::{
},
};
use super::{
use super::super::{
component::{Button, ButtonMsg::Clicked, ButtonStyleSheet},
constant::WIDTH,
theme::{
bootloader::{
@ -20,9 +21,6 @@ use super::{
},
WHITE,
},
Button,
ButtonMsg::Clicked,
ButtonStyleSheet,
};
const ICON_TOP: i16 = 17;
@ -51,7 +49,7 @@ pub struct ConfirmInfo<'a> {
pub close_button: Child<Button>,
}
pub struct Confirm<'a> {
pub struct ConfirmScreen<'a> {
bg: Pad,
content_pad: Pad,
bg_color: Color,
@ -64,7 +62,7 @@ pub struct Confirm<'a> {
show_info: bool,
}
impl<'a> Confirm<'a> {
impl<'a> ConfirmScreen<'a> {
pub fn new(
bg_color: Color,
left_button: Button,
@ -119,7 +117,7 @@ impl<'a> Confirm<'a> {
}
}
impl Component for Confirm<'_> {
impl Component for ConfirmScreen<'_> {
type Msg = ConfirmMsg;
fn place(&mut self, bounds: Rect) -> Rect {
@ -241,7 +239,7 @@ impl Component for Confirm<'_> {
}
#[cfg(feature = "ui_debug")]
impl crate::trace::Trace for Confirm<'_> {
impl crate::trace::Trace for ConfirmScreen<'_> {
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
t.component("BlConfirm");
}

View File

@ -11,10 +11,7 @@ use heapless::String;
use super::{
bootloader::welcome::Welcome,
component::{
bl_confirm::{Confirm, ConfirmTitle},
Button, ResultScreen, WelcomeScreen,
},
component::{Button, ResultScreen, WelcomeScreen},
cshape::{render_loader, LoaderRange},
fonts,
theme::{
@ -45,9 +42,11 @@ use super::theme::bootloader::BLD_WARN_COLOR;
use intro::Intro;
use menu::Menu;
mod confirm;
pub mod intro;
pub mod menu;
pub mod welcome;
use confirm::{Confirm, ConfirmTitle};
pub type BootloaderString = String<128>;

View File

@ -13,7 +13,7 @@ use crate::{
},
};
use super::theme;
use super::super::theme;
pub enum ButtonMsg {
Pressed,
@ -38,7 +38,10 @@ pub struct Button {
impl Button {
const LINE_SPACING: i16 = 7;
#[cfg(not(feature = "bootloader"))]
const SUBTEXT_STYLE: TextStyle = theme::label_menu_item_subtitle();
#[cfg(feature = "bootloader")]
const SUBTEXT_STYLE: TextStyle = theme::bootloader::TEXT_NORMAL;
pub const fn new(content: ButtonContent) -> Self {
Self {

View File

@ -10,8 +10,10 @@ use crate::{
};
use super::{
constant::WIDTH,
theme::{FATAL_ERROR_COLOR, ICON_WARNING40, RESULT_FOOTER_START, RESULT_PADDING, WHITE},
super::{
constant::WIDTH,
theme::{FATAL_ERROR_COLOR, ICON_WARNING40, RESULT_FOOTER_START, RESULT_PADDING, WHITE},
},
ResultFooter, ResultStyle,
};
@ -22,7 +24,7 @@ const MESSAGE_AREA_START: i16 = 90;
#[cfg(feature = "bootloader")]
const STYLE: &ResultStyle = &crate::ui::layout_eckhart::theme::bootloader::RESULT_WIPE;
#[cfg(not(feature = "bootloader"))]
const STYLE: &ResultStyle = &super::theme::RESULT_ERROR;
const STYLE: &ResultStyle = &super::super::theme::RESULT_ERROR;
pub struct ErrorScreen<'a> {
bg: Pad,

View File

@ -1,43 +1,9 @@
mod action_bar;
pub mod bl_confirm;
mod button;
mod error;
mod header;
mod hint;
mod hold_to_confirm;
mod keyboard;
mod number_input_screen;
mod result;
mod select_word_screen;
mod share_words;
mod text_screen;
mod vertical_menu;
mod vertical_menu_screen;
mod welcome_screen;
pub use action_bar::{ActionBar, ActionBarMsg};
pub use button::{Button, ButtonContent, ButtonMsg, ButtonStyle, ButtonStyleSheet, IconText};
pub use error::ErrorScreen;
pub use header::{Header, HeaderMsg};
pub use hint::Hint;
pub use hold_to_confirm::HoldToConfirmAnim;
#[cfg(feature = "translations")]
pub use keyboard::{
bip39::Bip39Input,
mnemonic::{MnemonicInput, MnemonicKeyboard, MnemonicKeyboardMsg},
passphrase::{PassphraseKeyboard, PassphraseKeyboardMsg},
pin::{PinKeyboard, PinKeyboardMsg},
slip39::Slip39Input,
word_count_screen::{SelectWordCountMsg, SelectWordCountScreen},
};
pub use number_input_screen::{NumberInputScreenMsg, NumberInputScreen};
pub use result::{ResultFooter, ResultScreen, ResultStyle};
pub use select_word_screen::{SelectWordMsg, SelectWordScreen};
#[cfg(feature = "translations")]
pub use share_words::{ShareWordsScreen, ShareWordsScreenMsg};
pub use text_screen::{AllowedTextContent, TextScreen, TextScreenMsg};
pub use vertical_menu::{VerticalMenu, VerticalMenuMsg, MENU_MAX_ITEMS};
pub use vertical_menu_screen::{VerticalMenuScreen, VerticalMenuScreenMsg};
pub use welcome_screen::WelcomeScreen;
use super::{constant, theme};

View File

@ -10,9 +10,9 @@ use crate::{
},
};
use super::{
super::fonts,
use super::super::{
constant::WIDTH,
fonts,
theme::{FG, RESULT_FOOTER_START, RESULT_PADDING},
};

View File

@ -5,7 +5,7 @@ use crate::ui::{
shape::Renderer,
};
use super::{super::fonts, theme};
use super::super::{fonts, theme};
const TEXT_BOTTOM_MARGIN: i16 = 54;
const ICON_TOP_MARGIN: i16 = 48;

View File

@ -13,7 +13,7 @@ use crate::{
},
};
use super::component::{
use super::firmware::{
AllowedTextContent, MnemonicInput, MnemonicKeyboard, MnemonicKeyboardMsg, NumberInputScreen,
NumberInputScreenMsg, PinKeyboard, PinKeyboardMsg, SelectWordCountMsg, SelectWordCountScreen,
SelectWordMsg, SelectWordScreen, TextScreen, TextScreenMsg,

View File

@ -9,8 +9,8 @@ use crate::{
};
use super::{
button::{Button, ButtonContent, ButtonMsg},
theme, ButtonStyleSheet, HoldToConfirmAnim,
super::component::{Button, ButtonContent, ButtonMsg, ButtonStyleSheet},
theme, HoldToConfirmAnim,
};
/// Component for control buttons in the bottom of the screen.

View File

@ -5,7 +5,6 @@ use crate::{
component::{text::TextStyle, Component, Event, EventCtx, Label},
display::{Color, Icon},
geometry::{Alignment2D, Insets, Offset, Rect},
layout_eckhart::constant,
lerp::Lerp,
shape::{self, Renderer},
util::animation_disabled,
@ -13,8 +12,8 @@ use crate::{
};
use super::{
button::{Button, ButtonContent, ButtonMsg},
theme,
super::component::{Button, ButtonContent, ButtonMsg},
constant, theme,
};
const ANIMATION_TIME_MS: u32 = 1000;

View File

@ -11,7 +11,7 @@ use crate::{
};
use super::{
super::{component::Header, cshape::ScreenBorder, theme},
super::{cshape::ScreenBorder, firmware::Header, theme},
constant::SCREEN,
};

View File

@ -8,14 +8,12 @@ use crate::{
};
use super::super::super::{
component::{
keyboard::{
common::{render_pending_marker, MultiTapKeyboard},
mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT},
},
Button, ButtonMsg,
},
component::{Button, ButtonMsg},
constant::WIDTH,
firmware::keyboard::{
common::{render_pending_marker, MultiTapKeyboard},
mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT},
},
theme,
};

View File

@ -9,7 +9,7 @@ use crate::{
use super::{
super::super::{
component::button::{Button, ButtonContent, ButtonMsg, ButtonStyleSheet},
component::{Button, ButtonContent, ButtonMsg, ButtonStyleSheet},
constant::SCREEN,
theme,
},

View File

@ -8,14 +8,12 @@ use crate::{
};
use super::super::super::{
component::{
button::ButtonContent,
keyboard::{
common::{INPUT_TOUCH_HEIGHT, KEYBOARD_INPUT_INSETS, KEYPAD_VISIBLE_HEIGHT},
keypad::{ButtonState, Keypad, KeypadButton, KeypadMsg},
},
},
component::ButtonContent,
constant::SCREEN,
firmware::keyboard::{
common::{INPUT_TOUCH_HEIGHT, KEYBOARD_INPUT_INSETS, KEYPAD_VISIBLE_HEIGHT},
keypad::{ButtonState, Keypad, KeypadButton, KeypadMsg},
},
theme,
};

View File

@ -22,7 +22,7 @@ use crate::{
};
use super::super::{
button::{Button, ButtonContent, ButtonMsg, ButtonStyleSheet},
super::component::{Button, ButtonContent, ButtonMsg, ButtonStyleSheet},
constant::SCREEN,
keyboard::{
common::{

View File

@ -16,19 +16,13 @@ use crate::{
},
};
use super::super::super::{
component::{
button::ButtonContent,
constant::SCREEN,
keyboard::{
common::{
DisplayStyle, FADING_ICON_COLORS, FADING_ICON_COUNT, INPUT_TOUCH_HEIGHT,
KEYBOARD_INPUT_INSETS, KEYBOARD_INPUT_RADIUS, KEYPAD_VISIBLE_HEIGHT,
},
keypad::{ButtonState, Keypad, KeypadMsg, KeypadState},
},
use super::{
super::super::{component::ButtonContent, constant::SCREEN, theme},
common::{
DisplayStyle, FADING_ICON_COLORS, FADING_ICON_COUNT, INPUT_TOUCH_HEIGHT,
KEYBOARD_INPUT_INSETS, KEYBOARD_INPUT_RADIUS, KEYPAD_VISIBLE_HEIGHT,
},
theme,
keypad::{ButtonState, Keypad, KeypadMsg, KeypadState},
};
pub enum PinKeyboardMsg {

View File

@ -14,12 +14,10 @@ use crate::{
};
use super::super::super::{
component::{
keyboard::{
common::{render_pending_marker, MultiTapKeyboard},
mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT},
},
Button, ButtonMsg,
component::{Button, ButtonMsg},
firmware::keyboard::{
common::{render_pending_marker, MultiTapKeyboard},
mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT},
},
theme,
};

View File

@ -8,8 +8,12 @@ use crate::{
};
use super::super::{
super::{super::constant::SCREEN, theme},
Button, ButtonMsg, Header,
super::{
super::constant::SCREEN,
component::{Button, ButtonMsg},
theme,
},
Header,
};
use heapless::Vec;

View File

@ -0,0 +1,34 @@
mod action_bar;
mod header;
mod hint;
mod hold_to_confirm;
mod keyboard;
mod number_input_screen;
mod select_word_screen;
mod share_words;
mod text_screen;
mod vertical_menu;
mod vertical_menu_screen;
pub use action_bar::{ActionBar, ActionBarMsg};
pub use header::{Header, HeaderMsg};
pub use hint::Hint;
pub use hold_to_confirm::HoldToConfirmAnim;
#[cfg(feature = "translations")]
pub use keyboard::{
bip39::Bip39Input,
mnemonic::{MnemonicInput, MnemonicKeyboard, MnemonicKeyboardMsg},
passphrase::{PassphraseKeyboard, PassphraseKeyboardMsg},
pin::{PinKeyboard, PinKeyboardMsg},
slip39::Slip39Input,
word_count_screen::{SelectWordCountMsg, SelectWordCountScreen},
};
pub use number_input_screen::{NumberInputScreen, NumberInputScreenMsg};
pub use select_word_screen::{SelectWordMsg, SelectWordScreen};
#[cfg(feature = "translations")]
pub use share_words::{ShareWordsScreen, ShareWordsScreenMsg};
pub use text_screen::{AllowedTextContent, TextScreen, TextScreenMsg};
pub use vertical_menu::{VerticalMenu, VerticalMenuMsg, MENU_MAX_ITEMS};
pub use vertical_menu_screen::{VerticalMenuScreen, VerticalMenuScreenMsg};
use super::{constant, theme};

View File

@ -9,8 +9,12 @@ use crate::{
};
use super::{
super::{super::constant::SCREEN, fonts, theme},
ActionBar, ActionBarMsg, Button, ButtonMsg, Header, HeaderMsg,
super::{
super::constant::SCREEN,
component::{Button, ButtonMsg},
fonts, theme,
},
ActionBar, ActionBarMsg, Header, HeaderMsg,
};
pub enum NumberInputScreenMsg {

View File

@ -9,8 +9,9 @@ use crate::{
};
use super::super::{
component::{Button, Header, HeaderMsg, VerticalMenu, VerticalMenuMsg},
component::Button,
constant::SCREEN,
firmware::{Header, HeaderMsg, VerticalMenu, VerticalMenuMsg},
theme,
};

View File

@ -15,8 +15,9 @@ use crate::{
use heapless::Vec;
use super::super::{
component::{button::Button, ActionBar, ActionBarMsg, Header, HeaderMsg, Hint},
component::Button,
constant::SCREEN,
firmware::{ActionBar, ActionBarMsg, Header, HeaderMsg, Hint},
fonts, theme,
};

View File

@ -10,7 +10,7 @@ use crate::ui::{
util::Pager,
};
pub(crate) use super::{action_bar::ActionBarMsg, ActionBar, Header, HeaderMsg, Hint};
use super::{action_bar::ActionBarMsg, ActionBar, Header, HeaderMsg, Hint};
/// Full-screen component for rendering text.
///

View File

@ -4,12 +4,11 @@ use crate::ui::{
shape::{Bar, Renderer},
};
use heapless::Vec;
use super::super::{
component::{Button, ButtonMsg},
use super::{
super::component::{Button, ButtonMsg},
theme,
};
use heapless::Vec;
/// Number of buttons.
/// Presently, VerticalMenu holds only fixed number of buttons.

View File

@ -14,10 +14,7 @@ use crate::{
},
};
use super::super::{
component::{constant::SCREEN, Header, HeaderMsg, VerticalMenu, VerticalMenuMsg},
theme,
};
use super::{constant::SCREEN, theme, Header, HeaderMsg, VerticalMenu, VerticalMenuMsg};
pub struct VerticalMenuScreen {
header: Header,

View File

@ -13,7 +13,7 @@ use crate::{
};
use super::super::{
component::{
firmware::{
ActionBar, Header, HeaderMsg, Hint, TextScreen, TextScreenMsg, VerticalMenu,
VerticalMenuScreen, VerticalMenuScreenMsg,
},

View File

@ -16,8 +16,9 @@ use crate::{
};
use super::super::{
component::{
ActionBar, Button, Header, HeaderMsg, Hint, TextScreen, TextScreenMsg, VerticalMenu,
component::Button,
firmware::{
ActionBar, Header, HeaderMsg, Hint, TextScreen, TextScreenMsg, VerticalMenu,
VerticalMenuScreen, VerticalMenuScreenMsg,
},
theme,

View File

@ -9,16 +9,17 @@ use crate::{
FlowController, FlowMsg, SwipeFlow,
},
geometry::Direction,
layout_eckhart::{
component::{
ActionBar, Button, Header, PassphraseKeyboard, PassphraseKeyboardMsg, TextScreen,
TextScreenMsg,
},
fonts, theme,
},
},
};
use super::super::{
component::Button,
firmware::{
ActionBar, Header, PassphraseKeyboard, PassphraseKeyboardMsg, TextScreen, TextScreenMsg,
},
fonts, theme,
};
#[derive(Copy, Clone, PartialEq, Eq)]
pub enum RequestPassphrase {
Keypad,

View File

@ -18,8 +18,9 @@ use crate::{
use heapless::Vec;
use super::super::{
component::{
ActionBar, Button, Header, ShareWordsScreen, ShareWordsScreenMsg, TextScreen, TextScreenMsg,
component::Button,
firmware::{
ActionBar, Header, ShareWordsScreen, ShareWordsScreenMsg, TextScreen, TextScreenMsg,
},
theme,
};

View File

@ -15,6 +15,8 @@ use crate::strutil::ShortString;
pub mod bootloader;
pub mod component;
pub mod constant;
#[cfg(feature = "micropython")]
pub mod firmware;
pub mod theme;
#[cfg(feature = "micropython")]
@ -24,6 +26,8 @@ pub mod cshape;
pub mod flow;
pub mod fonts;
pub mod screens;
#[cfg(feature = "bootloader")]
pub mod ui_bootloader;
#[cfg(feature = "micropython")]
pub mod ui_firmware;

View File

@ -6,10 +6,12 @@ use crate::ui::{
util::include_res,
};
use super::super::{
component::{ButtonStyle, ButtonStyleSheet, ResultStyle},
fonts,
theme::{BLACK, FG, GREY_DARK, GREY_LIGHT, WHITE},
use super::{
super::{
component::{ButtonStyle, ButtonStyleSheet, ResultStyle},
fonts,
},
BLACK, GREY_DARK, GREY_LIGHT, GREY_SUPER_DARK, WHITE,
};
pub const BLD_BG: Color = Color::rgb(0x00, 0x1E, 0xAD);
@ -89,10 +91,36 @@ pub fn button_confirm() -> ButtonStyleSheet {
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: FG,
text_color: BLD_FG,
button_color: GREY_DARK,
icon_color: BLD_BG,
background_color: FG,
background_color: BLD_FG,
},
}
}
pub const fn button_header() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: BLD_BG,
icon_color: GREY_LIGHT,
background_color: BLD_BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: GREY_SUPER_DARK,
icon_color: GREY_LIGHT,
background_color: BLD_BG,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: BLD_BG,
icon_color: GREY_LIGHT,
background_color: BLD_BG,
},
}
}
@ -141,10 +169,10 @@ pub fn button_wipe_confirm() -> ButtonStyleSheet {
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: FG,
text_color: BLD_FG,
button_color: GREY_DARK,
icon_color: FG,
background_color: FG,
icon_color: BLD_FG,
background_color: BLD_FG,
},
}
}
@ -260,4 +288,4 @@ pub const RESULT_WIPE: ResultStyle = ResultStyle::new(
pub const RESULT_FW_INSTALL: ResultStyle = ResultStyle::new(BLD_FG, BLD_BG, BLD_BTN_COLOR);
pub const RESULT_INITIAL: ResultStyle =
ResultStyle::new(FG, WELCOME_COLOR, WELCOME_HIGHLIGHT_COLOR);
ResultStyle::new(BLD_FG, WELCOME_COLOR, WELCOME_HIGHLIGHT_COLOR);

View File

@ -0,0 +1,471 @@
use crate::{time::Duration, ui::component::text::TextStyle};
use super::{
super::{
component::{ButtonStyle, ButtonStyleSheet},
fonts,
},
*,
};
pub const CONFIRM_HOLD_DURATION: Duration = Duration::from_millis(1500);
pub const ERASE_HOLD_DURATION: Duration = Duration::from_millis(1500);
// Text styles
/// Alias for use with copied code, might be deleted later
pub const TEXT_NORMAL: TextStyle = TEXT_MEDIUM;
/// TT Satoshi Extra Light - 72 (PIN keyboard, Wallet backup / word)
pub const TEXT_SUPER_BIG: TextStyle = TextStyle::new(
fonts::FONT_SATOSHI_EXTRALIGHT_72,
GREY_EXTRA_LIGHT,
BG,
GREY_EXTRA_LIGHT,
GREY_EXTRA_LIGHT,
);
/// TT Satoshi Extra Light - 46 (Char keyboard, Backup check)
pub const TEXT_BIG: TextStyle = TextStyle::new(
fonts::FONT_SATOSHI_EXTRALIGHT_46,
GREY_EXTRA_LIGHT,
BG,
GREY_EXTRA_LIGHT,
GREY_EXTRA_LIGHT,
);
/// TT Satoshi Regular - 38 (Screen text, Menu item label)
pub const TEXT_REGULAR: TextStyle = TextStyle::new(
fonts::FONT_SATOSHI_REGULAR_38,
GREY_EXTRA_LIGHT,
BG,
GREY_EXTRA_LIGHT,
GREY_EXTRA_LIGHT,
);
/// TT Satoshi Medium - 26 (Screen text, Button label, Input value)
pub const TEXT_MEDIUM: TextStyle = TextStyle::new(
fonts::FONT_SATOSHI_MEDIUM_26,
GREY_LIGHT,
BG,
GREY_LIGHT,
GREY_LIGHT,
);
/// TT Satoshi Regular - 22 (Screen title, Hint, PageCounter, Secondary info)
/// with negative line spacing to make it more compact
pub const TEXT_SMALL: TextStyle =
TextStyle::new(fonts::FONT_SATOSHI_REGULAR_22, GREY, BG, GREY, GREY).with_line_spacing(-4);
/// Roboto Mono Medium - 38 (Number value)
pub const TEXT_MONO_MEDIUM: TextStyle = TextStyle::new(
fonts::FONT_MONO_MEDIUM_38,
GREY_EXTRA_LIGHT,
BG,
GREY_EXTRA_LIGHT,
GREY_EXTRA_LIGHT,
);
/// Roboto Mono Light - 30 (Address, data)
pub const TEXT_MONO_LIGHT: TextStyle = TextStyle::new(
fonts::FONT_MONO_LIGHT_30,
GREY_EXTRA_LIGHT,
BG,
GREY_EXTRA_LIGHT,
GREY_EXTRA_LIGHT,
);
/// Decide the text style of chunkified text according to its length.
pub fn get_chunkified_text_style(_character_length: usize) -> &'static TextStyle {
// TODO: implement properly for Eckhart, see Delizia implemenation
&TEXT_MONO_MEDIUM
}
pub const TEXT_MONO_EXTRA_LIGHT: TextStyle = TextStyle::new(
fonts::FONT_MONO_LIGHT_30,
GREY_EXTRA_LIGHT,
BG,
GREY_EXTRA_LIGHT,
GREY_EXTRA_LIGHT,
);
pub const TEXT_CHECKLIST_INACTIVE: TextStyle = TextStyle::new(
fonts::FONT_SATOSHI_MEDIUM_26,
GREY_DARK,
BG,
GREY_DARK,
GREY_DARK,
);
const fn label_title(color: Color) -> TextStyle {
TextStyle::new(fonts::FONT_SATOSHI_REGULAR_22, color, BG, color, color).with_line_spacing(-4)
}
pub const fn label_title_main() -> TextStyle {
label_title(GREY)
}
pub const fn label_title_confirm() -> TextStyle {
label_title(GREEN_LIGHT)
}
pub const fn label_title_danger() -> TextStyle {
label_title(ORANGE)
}
pub const fn label_title_warning() -> TextStyle {
label_title(YELLOW)
}
pub const fn label_menu_item_subtitle() -> TextStyle {
TextStyle::new(fonts::FONT_SATOSHI_REGULAR_22, GREY, BG, GREY, GREY)
}
// Button styles
pub const fn button_confirm() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREEN_LIGHT,
button_color: BG,
icon_color: GREEN_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREEN,
button_color: GREY_SUPER_DARK,
icon_color: GREEN,
background_color: BG,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: GREY_DARK,
icon_color: GREY_LIGHT,
background_color: GREY_DARK,
},
}
}
pub const fn button_cancel() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_22, // unused
text_color: ORANGE, // unused
button_color: BG,
icon_color: ORANGE,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_22, // unused
text_color: ORANGE_DIMMED, //unused
button_color: ORANGE_EXTRA_DARK,
icon_color: ORANGE_DIMMED,
background_color: ORANGE_EXTRA_DARK,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_22, // unused
text_color: GREY_EXTRA_DARK, // unused
button_color: BG,
icon_color: GREY_EXTRA_DARK,
background_color: BG,
},
}
}
pub const fn button_warning_high() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: ORANGE,
button_color: BG,
icon_color: ORANGE,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: ORANGE,
button_color: GREY_SUPER_DARK,
icon_color: GREEN,
background_color: BG,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: ORANGE,
button_color: GREY_DARK,
icon_color: GREY_LIGHT,
background_color: GREY_DARK,
},
}
}
pub const fn button_header() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: GREY_SUPER_DARK,
icon_color: GREY_LIGHT,
background_color: BG,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
},
}
}
// Macro for styles differing only in text color
macro_rules! menu_item_title {
($color:expr) => {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_38,
text_color: $color,
button_color: BG,
icon_color: $color,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_38,
text_color: GREY_DARK,
button_color: GREY_SUPER_DARK,
icon_color: GREY_DARK,
background_color: GREY_SUPER_DARK,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_38,
text_color: GREY_DARK,
button_color: BG,
icon_color: GREY_DARK,
background_color: BG,
},
}
};
}
pub const fn menu_item_title() -> ButtonStyleSheet {
menu_item_title!(GREY_LIGHT)
}
pub const fn menu_item_title_yellow() -> ButtonStyleSheet {
menu_item_title!(YELLOW)
}
pub const fn menu_item_title_red() -> ButtonStyleSheet {
menu_item_title!(RED)
}
pub const fn button_select_word() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_46,
text_color: GREY_EXTRA_LIGHT,
button_color: BG,
icon_color: GREY_EXTRA_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_46,
text_color: GREY_DARK,
button_color: GREY_SUPER_DARK,
icon_color: GREY_DARK,
background_color: GREY_SUPER_DARK,
},
// unused
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_46,
text_color: BG,
button_color: BG,
icon_color: BG,
background_color: BG,
},
}
}
pub const fn button_keyboard() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_46,
text_color: GREY_EXTRA_LIGHT,
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_46,
text_color: GREY_DARK,
button_color: GREY_SUPER_DARK,
icon_color: GREY_DARK,
background_color: GREY_SUPER_DARK,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_46,
text_color: GREY_EXTRA_DARK,
button_color: BG,
icon_color: GREY_EXTRA_DARK,
background_color: BG,
},
}
}
pub const fn button_keyboard_numeric() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_72,
text_color: GREY_EXTRA_LIGHT,
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_72,
text_color: GREY_DARK,
button_color: GREY_SUPER_DARK,
icon_color: GREY_DARK,
background_color: GREY_SUPER_DARK,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_72,
text_color: GREY_EXTRA_DARK,
button_color: BG,
icon_color: GREY_EXTRA_DARK,
background_color: BG,
},
}
}
pub const fn button_keyboard_confirm() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_22, // unused
text_color: GREEN_LIGHT, // unused
button_color: BG,
icon_color: GREEN_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_22, // unused
text_color: GREEN, // unused
button_color: GREEN_EXTRA_DARK,
icon_color: GREEN,
background_color: GREEN_EXTRA_DARK,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_22, // unused
text_color: GREY_EXTRA_DARK, // unused
button_color: BG,
icon_color: GREY_EXTRA_DARK,
background_color: BG,
},
}
}
pub const fn button_keyboard_next() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_EXTRA_LIGHT,
button_color: BG,
icon_color: GREY_EXTRA_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_DARK,
button_color: GREY_SUPER_DARK,
icon_color: GREY_DARK,
background_color: GREY_SUPER_DARK,
},
// not used
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: BG,
button_color: BG,
icon_color: BG,
background_color: BG,
},
}
}
pub const fn input_mnemonic() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: GREY_SUPER_DARK,
icon_color: GREY_LIGHT,
background_color: GREY_SUPER_DARK,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
},
}
}
pub const fn input_mnemonic_suggestion() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_DARK,
button_color: BG,
icon_color: GREY_DARK,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: BG,
button_color: BG,
icon_color: BG,
background_color: BG,
},
}
}
pub const fn input_mnemonic_confirm() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREEN_LIGHT,
button_color: BG,
icon_color: GREEN_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREEN_LIGHT,
button_color: GREEN_EXTRA_DARK,
icon_color: GREEN_LIGHT,
background_color: GREEN_EXTRA_DARK,
},
disabled: &ButtonStyle {
// unused
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: BG,
button_color: BG,
icon_color: BG,
background_color: BG,
},
}
}

View File

@ -1,20 +1,18 @@
pub mod bootloader;
pub mod backlight;
#[cfg(feature = "bootloader")]
pub mod bootloader;
#[cfg(feature = "micropython")]
pub mod firmware;
#[cfg(feature = "micropython")]
pub use firmware::*;
use crate::{
time::Duration,
ui::{component::text::TextStyle, display::Color, util::include_icon},
};
use crate::ui::{display::Color, util::include_icon};
use super::{
component::{ButtonStyle, ButtonStyleSheet, ResultStyle},
fonts,
};
pub const CONFIRM_HOLD_DURATION: Duration = Duration::from_millis(2000);
pub const ERASE_HOLD_DURATION: Duration = Duration::from_millis(1500);
// Color palette.
pub const WHITE: Color = Color::rgb(0xFF, 0xFF, 0xFF);
pub const BLACK: Color = Color::rgb(0, 0, 0);
@ -96,97 +94,6 @@ include_icon!(ICON_BORDER_TR, "layout_eckhart/res/border/TR.toif");
include_icon!(ICON_PLUS, "layout_eckhart/res/plus.toif");
include_icon!(ICON_MINUS, "layout_eckhart/res/minus.toif");
// Text styles
/// Alias for use with copied code, might be deleted later
pub const TEXT_NORMAL: TextStyle = TEXT_MEDIUM;
/// TT Satoshi Extra Light - 72 (PIN keyboard, Wallet backup / word)
pub const TEXT_SUPER_BIG: TextStyle = TextStyle::new(
fonts::FONT_SATOSHI_EXTRALIGHT_72,
GREY_EXTRA_LIGHT,
BG,
GREY_EXTRA_LIGHT,
GREY_EXTRA_LIGHT,
);
/// TT Satoshi Extra Light - 46 (Char keyboard, Backup check)
pub const TEXT_BIG: TextStyle = TextStyle::new(
fonts::FONT_SATOSHI_EXTRALIGHT_46,
GREY_EXTRA_LIGHT,
BG,
GREY_EXTRA_LIGHT,
GREY_EXTRA_LIGHT,
);
/// TT Satoshi Regular - 38 (Screen text, Menu item label)
pub const TEXT_REGULAR: TextStyle = TextStyle::new(
fonts::FONT_SATOSHI_REGULAR_38,
GREY_EXTRA_LIGHT,
BG,
GREY_EXTRA_LIGHT,
GREY_EXTRA_LIGHT,
);
/// TT Satoshi Medium - 26 (Screen text, Button label, Input value)
pub const TEXT_MEDIUM: TextStyle = TextStyle::new(
fonts::FONT_SATOSHI_MEDIUM_26,
GREY_LIGHT,
BG,
GREY_LIGHT,
GREY_LIGHT,
);
/// TT Satoshi Regular - 22 (Screen title, Hint, PageCounter, Secondary info)
/// with negative line spacing to make it more compact
pub const TEXT_SMALL: TextStyle =
TextStyle::new(fonts::FONT_SATOSHI_REGULAR_22, GREY, BG, GREY, GREY).with_line_spacing(-4);
/// Roboto Mono Medium - 38 (Number value)
pub const TEXT_MONO_MEDIUM: TextStyle = TextStyle::new(
fonts::FONT_MONO_MEDIUM_38,
GREY_EXTRA_LIGHT,
BG,
GREY_EXTRA_LIGHT,
GREY_EXTRA_LIGHT,
);
/// Roboto Mono Light - 30 (Address, data)
pub const TEXT_MONO_LIGHT: TextStyle = TextStyle::new(
fonts::FONT_MONO_LIGHT_30,
GREY_EXTRA_LIGHT,
BG,
GREY_EXTRA_LIGHT,
GREY_EXTRA_LIGHT,
);
/// Decide the text style of chunkified text according to its length.
pub fn get_chunkified_text_style(_character_length: usize) -> &'static TextStyle {
// TODO: implement properly for Eckhart, see Delizia implemenation
&TEXT_MONO_MEDIUM
}
// Macro for styles differing only in text color
macro_rules! label_title {
($color:expr) => {
TextStyle::new(fonts::FONT_SATOSHI_REGULAR_22, $color, BG, $color, $color)
.with_line_spacing(-4)
};
}
pub const fn label_title_main() -> TextStyle {
label_title!(GREY)
}
pub const fn label_title_confirm() -> TextStyle {
label_title!(GREEN_LIGHT)
}
pub const fn label_title_danger() -> TextStyle {
label_title!(ORANGE)
}
pub const fn label_title_warning() -> TextStyle {
label_title!(YELLOW)
}
pub const fn label_menu_item_subtitle() -> TextStyle {
TextStyle::new(fonts::FONT_SATOSHI_REGULAR_22, GREY, BG, GREY, GREY)
}
// Button styles
pub const fn button_default() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
@ -213,362 +120,7 @@ pub const fn button_default() -> ButtonStyleSheet {
}
}
pub const fn button_confirm() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREEN_LIGHT,
button_color: BG,
icon_color: GREEN_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREEN,
button_color: GREY_SUPER_DARK,
icon_color: GREEN,
background_color: BG,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: GREY_DARK,
icon_color: GREY_LIGHT,
background_color: GREY_DARK,
},
}
}
pub const fn button_cancel() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_22, // unused
text_color: ORANGE, // unused
button_color: BG,
icon_color: ORANGE,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_22, // unused
text_color: ORANGE_DIMMED, //unused
button_color: ORANGE_EXTRA_DARK,
icon_color: ORANGE_DIMMED,
background_color: ORANGE_EXTRA_DARK,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_22, // unused
text_color: GREY_EXTRA_DARK, // unused
button_color: BG,
icon_color: GREY_EXTRA_DARK,
background_color: BG,
},
}
}
pub const fn button_warning_high() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: ORANGE,
button_color: BG,
icon_color: ORANGE,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: ORANGE,
button_color: GREY_SUPER_DARK,
icon_color: GREEN,
background_color: BG,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: ORANGE,
button_color: GREY_DARK,
icon_color: GREY_LIGHT,
background_color: GREY_DARK,
},
}
}
pub const fn button_header() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: GREY_SUPER_DARK,
icon_color: GREY_LIGHT,
background_color: BG,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
},
}
}
// Macro for styles differing only in text color
macro_rules! menu_item_title {
($color:expr) => {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_38,
text_color: $color,
button_color: BG,
icon_color: $color,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_38,
text_color: GREY_DARK,
button_color: GREY_SUPER_DARK,
icon_color: GREY_DARK,
background_color: GREY_SUPER_DARK,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_38,
text_color: GREY_DARK,
button_color: BG,
icon_color: GREY_DARK,
background_color: BG,
},
}
};
}
pub const fn menu_item_title() -> ButtonStyleSheet {
menu_item_title!(GREY_LIGHT)
}
pub const fn menu_item_title_yellow() -> ButtonStyleSheet {
menu_item_title!(YELLOW)
}
pub const fn menu_item_title_red() -> ButtonStyleSheet {
menu_item_title!(RED)
}
pub const fn button_select_word() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_46,
text_color: GREY_EXTRA_LIGHT,
button_color: BG,
icon_color: GREY_EXTRA_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_46,
text_color: GREY_DARK,
button_color: GREY_SUPER_DARK,
icon_color: GREY_DARK,
background_color: GREY_SUPER_DARK,
},
// unused
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_46,
text_color: BG,
button_color: BG,
icon_color: BG,
background_color: BG,
},
}
}
pub const fn button_keyboard() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_46,
text_color: GREY_EXTRA_LIGHT,
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_46,
text_color: GREY_DARK,
button_color: GREY_SUPER_DARK,
icon_color: GREY_DARK,
background_color: GREY_SUPER_DARK,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_46,
text_color: GREY_EXTRA_DARK,
button_color: BG,
icon_color: GREY_EXTRA_DARK,
background_color: BG,
},
}
}
pub const fn button_keyboard_numeric() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_72,
text_color: GREY_EXTRA_LIGHT,
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_72,
text_color: GREY_DARK,
button_color: GREY_SUPER_DARK,
icon_color: GREY_DARK,
background_color: GREY_SUPER_DARK,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_EXTRALIGHT_72,
text_color: GREY_EXTRA_DARK,
button_color: BG,
icon_color: GREY_EXTRA_DARK,
background_color: BG,
},
}
}
pub const fn button_keyboard_confirm() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_22, // unused
text_color: GREEN_LIGHT, // unused
button_color: BG,
icon_color: GREEN_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_22, // unused
text_color: GREEN, // unused
button_color: GREEN_EXTRA_DARK,
icon_color: GREEN,
background_color: GREEN_EXTRA_DARK,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_REGULAR_22, // unused
text_color: GREY_EXTRA_DARK, // unused
button_color: BG,
icon_color: GREY_EXTRA_DARK,
background_color: BG,
},
}
}
pub const fn button_keyboard_next() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_EXTRA_LIGHT,
button_color: BG,
icon_color: GREY_EXTRA_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_DARK,
button_color: GREY_SUPER_DARK,
icon_color: GREY_DARK,
background_color: GREY_SUPER_DARK,
},
// not used
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: BG,
button_color: BG,
icon_color: BG,
background_color: BG,
},
}
}
pub const fn input_mnemonic() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: GREY_SUPER_DARK,
icon_color: GREY_LIGHT,
background_color: GREY_SUPER_DARK,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
},
}
}
pub const fn input_mnemonic_suggestion() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_DARK,
button_color: BG,
icon_color: GREY_DARK,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREY_LIGHT,
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
},
disabled: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: BG,
button_color: BG,
icon_color: BG,
background_color: BG,
},
}
}
pub const fn input_mnemonic_confirm() -> ButtonStyleSheet {
ButtonStyleSheet {
normal: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREEN_LIGHT,
button_color: BG,
icon_color: GREEN_LIGHT,
background_color: BG,
},
active: &ButtonStyle {
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: GREEN_LIGHT,
button_color: GREEN_EXTRA_DARK,
icon_color: GREEN_LIGHT,
background_color: GREEN_EXTRA_DARK,
},
disabled: &ButtonStyle {
// unused
font: fonts::FONT_SATOSHI_MEDIUM_26,
text_color: BG,
button_color: BG,
icon_color: BG,
background_color: BG,
},
}
}
// Result constants
// Result constants
pub const RESULT_PADDING: i16 = 6;
pub const RESULT_FOOTER_START: i16 = 171;
pub const RESULT_FOOTER_HEIGHT: i16 = 62;

View File

@ -25,10 +25,10 @@ use crate::{
};
use super::{
component::{
ActionBar, Bip39Input, Button, Header, HeaderMsg, Hint, MnemonicKeyboard,
NumberInputScreen, PinKeyboard, SelectWordCountScreen, SelectWordScreen, Slip39Input,
TextScreen,
component::Button,
firmware::{
ActionBar, Bip39Input, Header, HeaderMsg, Hint, MnemonicKeyboard, NumberInputScreen,
PinKeyboard, SelectWordCountScreen, SelectWordScreen, Slip39Input, TextScreen,
},
flow, fonts, theme, UIEckhart,
};