mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-06-27 18:32:34 +00:00
refactor(eckhart): update fonts and disabled button style
- Fix translation pattern
This commit is contained in:
parent
fee5624590
commit
5cc3a0dfdb
@ -829,7 +829,7 @@ pub enum TranslatedString {
|
||||
reset__recovery_share_title_template = 567, // "Recovery share #{0}"
|
||||
reset__required_number_of_groups = 568, // "The required number of groups for recovery."
|
||||
reset__select_correct_word = 569, // "Select the correct word for each position."
|
||||
reset__select_word_template = 570, // {"Bolt": "Select {0} word", "Caesar": "Select {0} word", "Delizia": "Select {0} word", "Eckhart": "Select word no. {0} from your wallet backup"}
|
||||
reset__select_word_template = 570, // {"Bolt": "Select {0} word", "Caesar": "Select {0} word", "Delizia": "Select {0} word", "Eckhart": "Select word #{0} from your wallet backup"}
|
||||
reset__select_word_x_of_y_template = 571, // "Select word {0} of {1}:"
|
||||
reset__set_it_to_count_template = 572, // "Set it to {0} and you will need "
|
||||
reset__share_checked_successfully_template = 573, // "Share #{0} checked successfully."
|
||||
|
@ -57,7 +57,7 @@ impl<'a> PinKeyboard<'a> {
|
||||
.vertically_centered(),
|
||||
major_warning: major_warning
|
||||
.map(|text| Label::left_aligned(text, theme::TEXT_SMALL).vertically_centered()),
|
||||
input: PinInput::new(theme::TEXT_MONO_LIGHT),
|
||||
input: PinInput::new(),
|
||||
keypad: Keypad::new_numeric(true),
|
||||
warning_timer: Timer::new(),
|
||||
}
|
||||
@ -258,7 +258,6 @@ pub enum PinInputMsg {
|
||||
|
||||
struct PinInput {
|
||||
area: Rect,
|
||||
style: TextStyle,
|
||||
digits: ShortString,
|
||||
display_style: DisplayStyle,
|
||||
last_digit_timer: Timer,
|
||||
@ -278,10 +277,9 @@ impl PinInput {
|
||||
const ICON_WIDTH: i16 = Self::PIN_ICON.toif.width();
|
||||
const ICON_SPACE: i16 = 12;
|
||||
|
||||
fn new(style: TextStyle) -> Self {
|
||||
fn new() -> Self {
|
||||
Self {
|
||||
area: Rect::zero(),
|
||||
style,
|
||||
digits: ShortString::new(),
|
||||
display_style: DisplayStyle::Hidden,
|
||||
last_digit_timer: Timer::new(),
|
||||
|
@ -80,7 +80,7 @@ pub fn new_confirm_reset(recovery: bool) -> Result<SwipeFlow, error::Error> {
|
||||
let content_menu = VerticalMenuScreen::new(
|
||||
VerticalMenu::empty().item(
|
||||
Button::with_text(TR::buttons__cancel.into())
|
||||
.styled(theme::menu_item_title_red())
|
||||
.styled(theme::menu_item_title_orange())
|
||||
.with_text_align(Alignment::Start)
|
||||
.with_content_offset(Offset::x(12)),
|
||||
),
|
||||
|
@ -77,7 +77,7 @@ pub fn new_prompt_backup() -> Result<SwipeFlow, error::Error> {
|
||||
let content_menu = VerticalMenuScreen::new(
|
||||
VerticalMenu::empty().item(
|
||||
Button::with_text(TR::backup__title_skip.into())
|
||||
.styled(theme::menu_item_title_red())
|
||||
.styled(theme::menu_item_title_orange())
|
||||
.with_text_align(Alignment::Start)
|
||||
.with_content_offset(Offset::x(12)),
|
||||
),
|
||||
|
@ -1,4 +1,10 @@
|
||||
use crate::{time::Duration, ui::component::text::TextStyle};
|
||||
use crate::{
|
||||
time::Duration,
|
||||
ui::component::text::{
|
||||
layout::{Chunks, LineBreaking, PageBreaking},
|
||||
TextStyle,
|
||||
},
|
||||
};
|
||||
|
||||
use super::{
|
||||
super::{
|
||||
@ -61,16 +67,42 @@ pub const TEXT_MONO_MEDIUM: TextStyle = TextStyle::new(
|
||||
/// Roboto Mono Light - 30 (Address, data)
|
||||
pub const TEXT_MONO_LIGHT: TextStyle = TextStyle::new(
|
||||
fonts::FONT_MONO_LIGHT_30,
|
||||
GREY_LIGHT,
|
||||
BG,
|
||||
GREY_LIGHT,
|
||||
GREY_LIGHT,
|
||||
);
|
||||
|
||||
pub const TEXT_MEDIUM_EXTRA_LIGHT: TextStyle = TextStyle::new(
|
||||
fonts::FONT_SATOSHI_MEDIUM_26,
|
||||
GREY_EXTRA_LIGHT,
|
||||
BG,
|
||||
GREY_EXTRA_LIGHT,
|
||||
GREY_EXTRA_LIGHT,
|
||||
);
|
||||
|
||||
pub const TEXT_SMALL_LIGHT: TextStyle = TextStyle::new(
|
||||
fonts::FONT_SATOSHI_REGULAR_22,
|
||||
GREY_LIGHT,
|
||||
BG,
|
||||
GREY_LIGHT,
|
||||
GREY_LIGHT,
|
||||
)
|
||||
.with_line_spacing(-4);
|
||||
|
||||
/// Makes sure that the displayed text (usually address) will get divided into
|
||||
/// smaller chunks.
|
||||
pub const TEXT_MONO_ADDRESS_CHUNKS: TextStyle = TEXT_MONO_LIGHT
|
||||
.with_chunks(Chunks::new(4, 8))
|
||||
.with_line_spacing(24);
|
||||
|
||||
pub const TEXT_MONO_ADDRESS: TextStyle = TEXT_MONO_LIGHT
|
||||
.with_line_breaking(LineBreaking::BreakWordsNoHyphen)
|
||||
.with_page_breaking(PageBreaking::CutAndInsertEllipsis);
|
||||
|
||||
/// 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
|
||||
&TEXT_MONO_ADDRESS_CHUNKS
|
||||
}
|
||||
|
||||
pub const TEXT_MONO_EXTRA_LIGHT: TextStyle = TextStyle::new(
|
||||
@ -255,8 +287,8 @@ 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 menu_item_title_orange() -> ButtonStyleSheet {
|
||||
menu_item_title!(ORANGE)
|
||||
}
|
||||
|
||||
pub const fn button_select_word() -> ButtonStyleSheet {
|
||||
|
@ -113,9 +113,9 @@ pub const fn button_default() -> ButtonStyleSheet {
|
||||
disabled: &ButtonStyle {
|
||||
font: fonts::FONT_SATOSHI_MEDIUM_26,
|
||||
text_color: GREY_LIGHT,
|
||||
button_color: GREY_DARK,
|
||||
button_color: BG,
|
||||
icon_color: GREY_LIGHT,
|
||||
background_color: GREY_DARK,
|
||||
background_color: BG,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -694,7 +694,7 @@
|
||||
"Bolt": "Select {0} word",
|
||||
"Caesar": "Select {0} word",
|
||||
"Delizia": "Select {0} word",
|
||||
"Eckhart": "Select word no. {0} from your wallet backup"
|
||||
"Eckhart": "Select word #{0} from your wallet backup"
|
||||
},
|
||||
"reset__select_word_x_of_y_template": "Select word {0} of {1}:",
|
||||
"reset__set_it_to_count_template": "Set it to {0} and you will need ",
|
||||
|
Loading…
Reference in New Issue
Block a user