Skip to content

Commit

Permalink
refactor(eckhart): separate theme to fw and bld
Browse files Browse the repository at this point in the history
  • Loading branch information
obrusvit committed Mar 3, 2025
1 parent 4d01975 commit 1d2278d
Show file tree
Hide file tree
Showing 4 changed files with 508 additions and 466 deletions.
3 changes: 3 additions & 0 deletions core/embed/rust/src/ui/layout_eckhart/component/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
48 changes: 38 additions & 10 deletions core/embed/rust/src/ui/layout_eckhart/theme/bootloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
},
}
}
Expand Down Expand Up @@ -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,
},
}
}
Expand Down Expand Up @@ -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);
Loading

0 comments on commit 1d2278d

Please sign in to comment.