mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-06-26 18:02:35 +00:00
refactor(eckhart): separate FW comps and theme
This commit is contained in:
parent
72640f3518
commit
7a364fa215
@ -11,7 +11,8 @@ use crate::{
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::super::{
|
||||||
|
component::{Button, ButtonMsg::Clicked, ButtonStyleSheet},
|
||||||
constant::WIDTH,
|
constant::WIDTH,
|
||||||
theme::{
|
theme::{
|
||||||
bootloader::{
|
bootloader::{
|
||||||
@ -20,9 +21,6 @@ use super::{
|
|||||||
},
|
},
|
||||||
WHITE,
|
WHITE,
|
||||||
},
|
},
|
||||||
Button,
|
|
||||||
ButtonMsg::Clicked,
|
|
||||||
ButtonStyleSheet,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const ICON_TOP: i16 = 17;
|
const ICON_TOP: i16 = 17;
|
||||||
@ -51,7 +49,7 @@ pub struct ConfirmInfo<'a> {
|
|||||||
pub close_button: Child<Button>,
|
pub close_button: Child<Button>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Confirm<'a> {
|
pub struct ConfirmScreen<'a> {
|
||||||
bg: Pad,
|
bg: Pad,
|
||||||
content_pad: Pad,
|
content_pad: Pad,
|
||||||
bg_color: Color,
|
bg_color: Color,
|
||||||
@ -64,7 +62,7 @@ pub struct Confirm<'a> {
|
|||||||
show_info: bool,
|
show_info: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Confirm<'a> {
|
impl<'a> ConfirmScreen<'a> {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
bg_color: Color,
|
bg_color: Color,
|
||||||
left_button: Button,
|
left_button: Button,
|
||||||
@ -119,7 +117,7 @@ impl<'a> Confirm<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Component for Confirm<'_> {
|
impl Component for ConfirmScreen<'_> {
|
||||||
type Msg = ConfirmMsg;
|
type Msg = ConfirmMsg;
|
||||||
|
|
||||||
fn place(&mut self, bounds: Rect) -> Rect {
|
fn place(&mut self, bounds: Rect) -> Rect {
|
||||||
@ -241,7 +239,7 @@ impl Component for Confirm<'_> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "ui_debug")]
|
#[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) {
|
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
|
||||||
t.component("BlConfirm");
|
t.component("BlConfirm");
|
||||||
}
|
}
|
@ -11,10 +11,7 @@ use heapless::String;
|
|||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
bootloader::welcome::Welcome,
|
bootloader::welcome::Welcome,
|
||||||
component::{
|
component::{Button, ResultScreen, WelcomeScreen},
|
||||||
bl_confirm::{Confirm, ConfirmTitle},
|
|
||||||
Button, ResultScreen, WelcomeScreen,
|
|
||||||
},
|
|
||||||
cshape::{render_loader, LoaderRange},
|
cshape::{render_loader, LoaderRange},
|
||||||
fonts,
|
fonts,
|
||||||
theme::{
|
theme::{
|
||||||
@ -45,9 +42,11 @@ use super::theme::bootloader::BLD_WARN_COLOR;
|
|||||||
use intro::Intro;
|
use intro::Intro;
|
||||||
use menu::Menu;
|
use menu::Menu;
|
||||||
|
|
||||||
|
mod confirm;
|
||||||
pub mod intro;
|
pub mod intro;
|
||||||
pub mod menu;
|
pub mod menu;
|
||||||
pub mod welcome;
|
pub mod welcome;
|
||||||
|
use confirm::{Confirm, ConfirmTitle};
|
||||||
|
|
||||||
pub type BootloaderString = String<128>;
|
pub type BootloaderString = String<128>;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ use crate::{
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::theme;
|
use super::super::theme;
|
||||||
|
|
||||||
pub enum ButtonMsg {
|
pub enum ButtonMsg {
|
||||||
Pressed,
|
Pressed,
|
||||||
@ -38,7 +38,10 @@ pub struct Button {
|
|||||||
|
|
||||||
impl Button {
|
impl Button {
|
||||||
const LINE_SPACING: i16 = 7;
|
const LINE_SPACING: i16 = 7;
|
||||||
|
#[cfg(not(feature = "bootloader"))]
|
||||||
const SUBTEXT_STYLE: TextStyle = theme::label_menu_item_subtitle();
|
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 {
|
pub const fn new(content: ButtonContent) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
@ -10,8 +10,10 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
constant::WIDTH,
|
super::{
|
||||||
theme::{FATAL_ERROR_COLOR, ICON_WARNING40, RESULT_FOOTER_START, RESULT_PADDING, WHITE},
|
constant::WIDTH,
|
||||||
|
theme::{FATAL_ERROR_COLOR, ICON_WARNING40, RESULT_FOOTER_START, RESULT_PADDING, WHITE},
|
||||||
|
},
|
||||||
ResultFooter, ResultStyle,
|
ResultFooter, ResultStyle,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -22,7 +24,7 @@ const MESSAGE_AREA_START: i16 = 90;
|
|||||||
#[cfg(feature = "bootloader")]
|
#[cfg(feature = "bootloader")]
|
||||||
const STYLE: &ResultStyle = &crate::ui::layout_eckhart::theme::bootloader::RESULT_WIPE;
|
const STYLE: &ResultStyle = &crate::ui::layout_eckhart::theme::bootloader::RESULT_WIPE;
|
||||||
#[cfg(not(feature = "bootloader"))]
|
#[cfg(not(feature = "bootloader"))]
|
||||||
const STYLE: &ResultStyle = &super::theme::RESULT_ERROR;
|
const STYLE: &ResultStyle = &super::super::theme::RESULT_ERROR;
|
||||||
|
|
||||||
pub struct ErrorScreen<'a> {
|
pub struct ErrorScreen<'a> {
|
||||||
bg: Pad,
|
bg: Pad,
|
||||||
|
@ -1,43 +1,9 @@
|
|||||||
mod action_bar;
|
|
||||||
pub mod bl_confirm;
|
|
||||||
mod button;
|
mod button;
|
||||||
mod error;
|
mod error;
|
||||||
mod header;
|
|
||||||
mod hint;
|
|
||||||
mod hold_to_confirm;
|
|
||||||
mod keyboard;
|
|
||||||
mod number_input_screen;
|
|
||||||
mod result;
|
mod result;
|
||||||
mod select_word_screen;
|
|
||||||
mod share_words;
|
|
||||||
mod text_screen;
|
|
||||||
mod vertical_menu;
|
|
||||||
mod vertical_menu_screen;
|
|
||||||
mod welcome_screen;
|
mod welcome_screen;
|
||||||
|
|
||||||
pub use action_bar::{ActionBar, ActionBarMsg};
|
|
||||||
pub use button::{Button, ButtonContent, ButtonMsg, ButtonStyle, ButtonStyleSheet, IconText};
|
pub use button::{Button, ButtonContent, ButtonMsg, ButtonStyle, ButtonStyleSheet, IconText};
|
||||||
pub use error::ErrorScreen;
|
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 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;
|
pub use welcome_screen::WelcomeScreen;
|
||||||
|
|
||||||
use super::{constant, theme};
|
|
||||||
|
@ -10,9 +10,9 @@ use crate::{
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::super::{
|
||||||
super::fonts,
|
|
||||||
constant::WIDTH,
|
constant::WIDTH,
|
||||||
|
fonts,
|
||||||
theme::{FG, RESULT_FOOTER_START, RESULT_PADDING},
|
theme::{FG, RESULT_FOOTER_START, RESULT_PADDING},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ use crate::ui::{
|
|||||||
shape::Renderer,
|
shape::Renderer,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{super::fonts, theme};
|
use super::super::{fonts, theme};
|
||||||
|
|
||||||
const TEXT_BOTTOM_MARGIN: i16 = 54;
|
const TEXT_BOTTOM_MARGIN: i16 = 54;
|
||||||
const ICON_TOP_MARGIN: i16 = 48;
|
const ICON_TOP_MARGIN: i16 = 48;
|
||||||
|
@ -13,7 +13,7 @@ use crate::{
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::component::{
|
use super::firmware::{
|
||||||
AllowedTextContent, MnemonicInput, MnemonicKeyboard, MnemonicKeyboardMsg, NumberInputScreen,
|
AllowedTextContent, MnemonicInput, MnemonicKeyboard, MnemonicKeyboardMsg, NumberInputScreen,
|
||||||
NumberInputScreenMsg, PinKeyboard, PinKeyboardMsg, SelectWordCountMsg, SelectWordCountScreen,
|
NumberInputScreenMsg, PinKeyboard, PinKeyboardMsg, SelectWordCountMsg, SelectWordCountScreen,
|
||||||
SelectWordMsg, SelectWordScreen, TextScreen, TextScreenMsg,
|
SelectWordMsg, SelectWordScreen, TextScreen, TextScreenMsg,
|
||||||
|
@ -9,8 +9,8 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
button::{Button, ButtonContent, ButtonMsg},
|
super::component::{Button, ButtonContent, ButtonMsg, ButtonStyleSheet},
|
||||||
theme, ButtonStyleSheet, HoldToConfirmAnim,
|
theme, HoldToConfirmAnim,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Component for control buttons in the bottom of the screen.
|
/// Component for control buttons in the bottom of the screen.
|
@ -5,7 +5,6 @@ use crate::{
|
|||||||
component::{text::TextStyle, Component, Event, EventCtx, Label},
|
component::{text::TextStyle, Component, Event, EventCtx, Label},
|
||||||
display::{Color, Icon},
|
display::{Color, Icon},
|
||||||
geometry::{Alignment2D, Insets, Offset, Rect},
|
geometry::{Alignment2D, Insets, Offset, Rect},
|
||||||
layout_eckhart::constant,
|
|
||||||
lerp::Lerp,
|
lerp::Lerp,
|
||||||
shape::{self, Renderer},
|
shape::{self, Renderer},
|
||||||
util::animation_disabled,
|
util::animation_disabled,
|
||||||
@ -13,8 +12,8 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
button::{Button, ButtonContent, ButtonMsg},
|
super::component::{Button, ButtonContent, ButtonMsg},
|
||||||
theme,
|
constant, theme,
|
||||||
};
|
};
|
||||||
|
|
||||||
const ANIMATION_TIME_MS: u32 = 1000;
|
const ANIMATION_TIME_MS: u32 = 1000;
|
@ -11,7 +11,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
super::{component::Header, cshape::ScreenBorder, theme},
|
super::{cshape::ScreenBorder, firmware::Header, theme},
|
||||||
constant::SCREEN,
|
constant::SCREEN,
|
||||||
};
|
};
|
||||||
|
|
@ -8,14 +8,12 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::super::super::{
|
use super::super::super::{
|
||||||
component::{
|
component::{Button, ButtonMsg},
|
||||||
keyboard::{
|
|
||||||
common::{render_pending_marker, MultiTapKeyboard},
|
|
||||||
mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT},
|
|
||||||
},
|
|
||||||
Button, ButtonMsg,
|
|
||||||
},
|
|
||||||
constant::WIDTH,
|
constant::WIDTH,
|
||||||
|
firmware::keyboard::{
|
||||||
|
common::{render_pending_marker, MultiTapKeyboard},
|
||||||
|
mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT},
|
||||||
|
},
|
||||||
theme,
|
theme,
|
||||||
};
|
};
|
||||||
|
|
@ -9,7 +9,7 @@ use crate::{
|
|||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
super::super::{
|
super::super::{
|
||||||
component::button::{Button, ButtonContent, ButtonMsg, ButtonStyleSheet},
|
component::{Button, ButtonContent, ButtonMsg, ButtonStyleSheet},
|
||||||
constant::SCREEN,
|
constant::SCREEN,
|
||||||
theme,
|
theme,
|
||||||
},
|
},
|
@ -8,14 +8,12 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::super::super::{
|
use super::super::super::{
|
||||||
component::{
|
component::ButtonContent,
|
||||||
button::ButtonContent,
|
|
||||||
keyboard::{
|
|
||||||
common::{INPUT_TOUCH_HEIGHT, KEYBOARD_INPUT_INSETS, KEYPAD_VISIBLE_HEIGHT},
|
|
||||||
keypad::{ButtonState, Keypad, KeypadButton, KeypadMsg},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
constant::SCREEN,
|
constant::SCREEN,
|
||||||
|
firmware::keyboard::{
|
||||||
|
common::{INPUT_TOUCH_HEIGHT, KEYBOARD_INPUT_INSETS, KEYPAD_VISIBLE_HEIGHT},
|
||||||
|
keypad::{ButtonState, Keypad, KeypadButton, KeypadMsg},
|
||||||
|
},
|
||||||
theme,
|
theme,
|
||||||
};
|
};
|
||||||
|
|
@ -22,7 +22,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::super::{
|
use super::super::{
|
||||||
button::{Button, ButtonContent, ButtonMsg, ButtonStyleSheet},
|
super::component::{Button, ButtonContent, ButtonMsg, ButtonStyleSheet},
|
||||||
constant::SCREEN,
|
constant::SCREEN,
|
||||||
keyboard::{
|
keyboard::{
|
||||||
common::{
|
common::{
|
@ -16,19 +16,13 @@ use crate::{
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::super::super::{
|
use super::{
|
||||||
component::{
|
super::super::{component::ButtonContent, constant::SCREEN, theme},
|
||||||
button::ButtonContent,
|
common::{
|
||||||
constant::SCREEN,
|
DisplayStyle, FADING_ICON_COLORS, FADING_ICON_COUNT, INPUT_TOUCH_HEIGHT,
|
||||||
keyboard::{
|
KEYBOARD_INPUT_INSETS, KEYBOARD_INPUT_RADIUS, KEYPAD_VISIBLE_HEIGHT,
|
||||||
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},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
theme,
|
keypad::{ButtonState, Keypad, KeypadMsg, KeypadState},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub enum PinKeyboardMsg {
|
pub enum PinKeyboardMsg {
|
@ -14,12 +14,10 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::super::super::{
|
use super::super::super::{
|
||||||
component::{
|
component::{Button, ButtonMsg},
|
||||||
keyboard::{
|
firmware::keyboard::{
|
||||||
common::{render_pending_marker, MultiTapKeyboard},
|
common::{render_pending_marker, MultiTapKeyboard},
|
||||||
mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT},
|
mnemonic::{MnemonicInput, MnemonicInputMsg, MNEMONIC_KEY_COUNT},
|
||||||
},
|
|
||||||
Button, ButtonMsg,
|
|
||||||
},
|
},
|
||||||
theme,
|
theme,
|
||||||
};
|
};
|
@ -8,8 +8,12 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::super::{
|
use super::super::{
|
||||||
super::{super::constant::SCREEN, theme},
|
super::{
|
||||||
Button, ButtonMsg, Header,
|
super::constant::SCREEN,
|
||||||
|
component::{Button, ButtonMsg},
|
||||||
|
theme,
|
||||||
|
},
|
||||||
|
Header,
|
||||||
};
|
};
|
||||||
|
|
||||||
use heapless::Vec;
|
use heapless::Vec;
|
34
core/embed/rust/src/ui/layout_eckhart/firmware/mod.rs
Normal file
34
core/embed/rust/src/ui/layout_eckhart/firmware/mod.rs
Normal 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};
|
@ -9,8 +9,12 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
super::{super::constant::SCREEN, fonts, theme},
|
super::{
|
||||||
ActionBar, ActionBarMsg, Button, ButtonMsg, Header, HeaderMsg,
|
super::constant::SCREEN,
|
||||||
|
component::{Button, ButtonMsg},
|
||||||
|
fonts, theme,
|
||||||
|
},
|
||||||
|
ActionBar, ActionBarMsg, Header, HeaderMsg,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub enum NumberInputScreenMsg {
|
pub enum NumberInputScreenMsg {
|
@ -9,8 +9,9 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::super::{
|
use super::super::{
|
||||||
component::{Button, Header, HeaderMsg, VerticalMenu, VerticalMenuMsg},
|
component::Button,
|
||||||
constant::SCREEN,
|
constant::SCREEN,
|
||||||
|
firmware::{Header, HeaderMsg, VerticalMenu, VerticalMenuMsg},
|
||||||
theme,
|
theme,
|
||||||
};
|
};
|
||||||
|
|
@ -15,8 +15,9 @@ use crate::{
|
|||||||
use heapless::Vec;
|
use heapless::Vec;
|
||||||
|
|
||||||
use super::super::{
|
use super::super::{
|
||||||
component::{button::Button, ActionBar, ActionBarMsg, Header, HeaderMsg, Hint},
|
component::Button,
|
||||||
constant::SCREEN,
|
constant::SCREEN,
|
||||||
|
firmware::{ActionBar, ActionBarMsg, Header, HeaderMsg, Hint},
|
||||||
fonts, theme,
|
fonts, theme,
|
||||||
};
|
};
|
||||||
|
|
@ -10,7 +10,7 @@ use crate::ui::{
|
|||||||
util::Pager,
|
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.
|
/// Full-screen component for rendering text.
|
||||||
///
|
///
|
@ -4,12 +4,11 @@ use crate::ui::{
|
|||||||
shape::{Bar, Renderer},
|
shape::{Bar, Renderer},
|
||||||
};
|
};
|
||||||
|
|
||||||
use heapless::Vec;
|
use super::{
|
||||||
|
super::component::{Button, ButtonMsg},
|
||||||
use super::super::{
|
|
||||||
component::{Button, ButtonMsg},
|
|
||||||
theme,
|
theme,
|
||||||
};
|
};
|
||||||
|
use heapless::Vec;
|
||||||
|
|
||||||
/// Number of buttons.
|
/// Number of buttons.
|
||||||
/// Presently, VerticalMenu holds only fixed number of buttons.
|
/// Presently, VerticalMenu holds only fixed number of buttons.
|
@ -14,10 +14,7 @@ use crate::{
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::super::{
|
use super::{constant::SCREEN, theme, Header, HeaderMsg, VerticalMenu, VerticalMenuMsg};
|
||||||
component::{constant::SCREEN, Header, HeaderMsg, VerticalMenu, VerticalMenuMsg},
|
|
||||||
theme,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub struct VerticalMenuScreen {
|
pub struct VerticalMenuScreen {
|
||||||
header: Header,
|
header: Header,
|
@ -13,7 +13,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::super::{
|
use super::super::{
|
||||||
component::{
|
firmware::{
|
||||||
ActionBar, Header, HeaderMsg, Hint, TextScreen, TextScreenMsg, VerticalMenu,
|
ActionBar, Header, HeaderMsg, Hint, TextScreen, TextScreenMsg, VerticalMenu,
|
||||||
VerticalMenuScreen, VerticalMenuScreenMsg,
|
VerticalMenuScreen, VerticalMenuScreenMsg,
|
||||||
},
|
},
|
||||||
|
@ -16,8 +16,9 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::super::{
|
use super::super::{
|
||||||
component::{
|
component::Button,
|
||||||
ActionBar, Button, Header, HeaderMsg, Hint, TextScreen, TextScreenMsg, VerticalMenu,
|
firmware::{
|
||||||
|
ActionBar, Header, HeaderMsg, Hint, TextScreen, TextScreenMsg, VerticalMenu,
|
||||||
VerticalMenuScreen, VerticalMenuScreenMsg,
|
VerticalMenuScreen, VerticalMenuScreenMsg,
|
||||||
},
|
},
|
||||||
theme,
|
theme,
|
||||||
|
@ -9,16 +9,17 @@ use crate::{
|
|||||||
FlowController, FlowMsg, SwipeFlow,
|
FlowController, FlowMsg, SwipeFlow,
|
||||||
},
|
},
|
||||||
geometry::Direction,
|
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)]
|
#[derive(Copy, Clone, PartialEq, Eq)]
|
||||||
pub enum RequestPassphrase {
|
pub enum RequestPassphrase {
|
||||||
Keypad,
|
Keypad,
|
||||||
|
@ -18,8 +18,9 @@ use crate::{
|
|||||||
use heapless::Vec;
|
use heapless::Vec;
|
||||||
|
|
||||||
use super::super::{
|
use super::super::{
|
||||||
component::{
|
component::Button,
|
||||||
ActionBar, Button, Header, ShareWordsScreen, ShareWordsScreenMsg, TextScreen, TextScreenMsg,
|
firmware::{
|
||||||
|
ActionBar, Header, ShareWordsScreen, ShareWordsScreenMsg, TextScreen, TextScreenMsg,
|
||||||
},
|
},
|
||||||
theme,
|
theme,
|
||||||
};
|
};
|
||||||
|
@ -15,6 +15,8 @@ use crate::strutil::ShortString;
|
|||||||
pub mod bootloader;
|
pub mod bootloader;
|
||||||
pub mod component;
|
pub mod component;
|
||||||
pub mod constant;
|
pub mod constant;
|
||||||
|
#[cfg(feature = "micropython")]
|
||||||
|
pub mod firmware;
|
||||||
pub mod theme;
|
pub mod theme;
|
||||||
|
|
||||||
#[cfg(feature = "micropython")]
|
#[cfg(feature = "micropython")]
|
||||||
@ -24,6 +26,8 @@ pub mod cshape;
|
|||||||
pub mod flow;
|
pub mod flow;
|
||||||
pub mod fonts;
|
pub mod fonts;
|
||||||
pub mod screens;
|
pub mod screens;
|
||||||
|
#[cfg(feature = "bootloader")]
|
||||||
|
pub mod ui_bootloader;
|
||||||
#[cfg(feature = "micropython")]
|
#[cfg(feature = "micropython")]
|
||||||
pub mod ui_firmware;
|
pub mod ui_firmware;
|
||||||
|
|
||||||
|
@ -6,10 +6,12 @@ use crate::ui::{
|
|||||||
util::include_res,
|
util::include_res,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::super::{
|
use super::{
|
||||||
component::{ButtonStyle, ButtonStyleSheet, ResultStyle},
|
super::{
|
||||||
fonts,
|
component::{ButtonStyle, ButtonStyleSheet, ResultStyle},
|
||||||
theme::{BLACK, FG, GREY_DARK, GREY_LIGHT, WHITE},
|
fonts,
|
||||||
|
},
|
||||||
|
BLACK, GREY_DARK, GREY_LIGHT, GREY_SUPER_DARK, WHITE,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const BLD_BG: Color = Color::rgb(0x00, 0x1E, 0xAD);
|
pub const BLD_BG: Color = Color::rgb(0x00, 0x1E, 0xAD);
|
||||||
@ -89,10 +91,36 @@ pub fn button_confirm() -> ButtonStyleSheet {
|
|||||||
},
|
},
|
||||||
disabled: &ButtonStyle {
|
disabled: &ButtonStyle {
|
||||||
font: fonts::FONT_SATOSHI_MEDIUM_26,
|
font: fonts::FONT_SATOSHI_MEDIUM_26,
|
||||||
text_color: FG,
|
text_color: BLD_FG,
|
||||||
button_color: GREY_DARK,
|
button_color: GREY_DARK,
|
||||||
icon_color: BLD_BG,
|
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 {
|
disabled: &ButtonStyle {
|
||||||
font: fonts::FONT_SATOSHI_MEDIUM_26,
|
font: fonts::FONT_SATOSHI_MEDIUM_26,
|
||||||
text_color: FG,
|
text_color: BLD_FG,
|
||||||
button_color: GREY_DARK,
|
button_color: GREY_DARK,
|
||||||
icon_color: FG,
|
icon_color: BLD_FG,
|
||||||
background_color: 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_FW_INSTALL: ResultStyle = ResultStyle::new(BLD_FG, BLD_BG, BLD_BTN_COLOR);
|
||||||
|
|
||||||
pub const RESULT_INITIAL: ResultStyle =
|
pub const RESULT_INITIAL: ResultStyle =
|
||||||
ResultStyle::new(FG, WELCOME_COLOR, WELCOME_HIGHLIGHT_COLOR);
|
ResultStyle::new(BLD_FG, WELCOME_COLOR, WELCOME_HIGHLIGHT_COLOR);
|
||||||
|
471
core/embed/rust/src/ui/layout_eckhart/theme/firmware.rs
Normal file
471
core/embed/rust/src/ui/layout_eckhart/theme/firmware.rs
Normal 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,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
@ -1,20 +1,18 @@
|
|||||||
pub mod bootloader;
|
|
||||||
|
|
||||||
pub mod backlight;
|
pub mod backlight;
|
||||||
|
#[cfg(feature = "bootloader")]
|
||||||
|
pub mod bootloader;
|
||||||
|
#[cfg(feature = "micropython")]
|
||||||
|
pub mod firmware;
|
||||||
|
#[cfg(feature = "micropython")]
|
||||||
|
pub use firmware::*;
|
||||||
|
|
||||||
use crate::{
|
use crate::ui::{display::Color, util::include_icon};
|
||||||
time::Duration,
|
|
||||||
ui::{component::text::TextStyle, display::Color, util::include_icon},
|
|
||||||
};
|
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
component::{ButtonStyle, ButtonStyleSheet, ResultStyle},
|
component::{ButtonStyle, ButtonStyleSheet, ResultStyle},
|
||||||
fonts,
|
fonts,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const CONFIRM_HOLD_DURATION: Duration = Duration::from_millis(2000);
|
|
||||||
pub const ERASE_HOLD_DURATION: Duration = Duration::from_millis(1500);
|
|
||||||
|
|
||||||
// Color palette.
|
// Color palette.
|
||||||
pub const WHITE: Color = Color::rgb(0xFF, 0xFF, 0xFF);
|
pub const WHITE: Color = Color::rgb(0xFF, 0xFF, 0xFF);
|
||||||
pub const BLACK: Color = Color::rgb(0, 0, 0);
|
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_PLUS, "layout_eckhart/res/plus.toif");
|
||||||
include_icon!(ICON_MINUS, "layout_eckhart/res/minus.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 {
|
pub const fn button_default() -> ButtonStyleSheet {
|
||||||
ButtonStyleSheet {
|
ButtonStyleSheet {
|
||||||
normal: &ButtonStyle {
|
normal: &ButtonStyle {
|
||||||
@ -213,362 +120,7 @@ pub const fn button_default() -> ButtonStyleSheet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn button_confirm() -> ButtonStyleSheet {
|
// Result constants
|
||||||
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
|
|
||||||
pub const RESULT_PADDING: i16 = 6;
|
pub const RESULT_PADDING: i16 = 6;
|
||||||
pub const RESULT_FOOTER_START: i16 = 171;
|
pub const RESULT_FOOTER_START: i16 = 171;
|
||||||
pub const RESULT_FOOTER_HEIGHT: i16 = 62;
|
pub const RESULT_FOOTER_HEIGHT: i16 = 62;
|
||||||
|
@ -25,10 +25,10 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
component::{
|
component::Button,
|
||||||
ActionBar, Bip39Input, Button, Header, HeaderMsg, Hint, MnemonicKeyboard,
|
firmware::{
|
||||||
NumberInputScreen, PinKeyboard, SelectWordCountScreen, SelectWordScreen, Slip39Input,
|
ActionBar, Bip39Input, Header, HeaderMsg, Hint, MnemonicKeyboard, NumberInputScreen,
|
||||||
TextScreen,
|
PinKeyboard, SelectWordCountScreen, SelectWordScreen, Slip39Input, TextScreen,
|
||||||
},
|
},
|
||||||
flow, fonts, theme, UIEckhart,
|
flow, fonts, theme, UIEckhart,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user