fix(core/ui): remove border from T3T1 buttons

According to Figma designs, there will be no rounded buttons in T3T1, so
the ButtonStyle does not need these fields.

[no changelog]
pull/3740/head
obrusvit 3 weeks ago committed by Martin Milata
parent 98287f550d
commit 4957ddefc7

@ -163,30 +163,7 @@ impl Button {
match &self.content {
ButtonContent::IconBlend(_, _, _) => {}
_ => {
if style.border_width > 0 {
// Paint the border and a smaller background on top of it.
display::rect_fill_rounded(
self.area,
style.border_color,
style.background_color,
style.border_radius,
);
display::rect_fill_rounded(
self.area.inset(Insets::uniform(style.border_width)),
style.button_color,
style.border_color,
style.border_radius,
);
} else {
// We do not need to draw an explicit border in this case, just a
// bigger background.
display::rect_fill_rounded(
self.area,
style.button_color,
style.background_color,
style.border_radius,
);
}
display::rect_fill(self.area, style.button_color);
}
}
}
@ -196,9 +173,7 @@ impl Button {
ButtonContent::IconBlend(_, _, _) => {}
_ => shape::Bar::new(self.area)
.with_bg(style.button_color)
.with_fg(style.border_color)
.with_thickness(style.border_width)
.with_radius(style.border_radius as i16)
.with_fg(style.button_color)
.render(target),
}
}
@ -413,7 +388,6 @@ pub struct ButtonStyleSheet {
pub disabled: &'static ButtonStyle,
}
// TODO: radius and borders not needed in T3T1 - sync with BL
#[derive(PartialEq, Eq)]
pub struct ButtonStyle {
pub font: Font,
@ -421,9 +395,6 @@ pub struct ButtonStyle {
pub button_color: Color,
pub icon_color: Color,
pub background_color: Color,
pub border_color: Color,
pub border_radius: u8,
pub border_width: i16,
}
impl Button {

@ -77,9 +77,6 @@ pub fn button_confirm() -> ButtonStyleSheet {
button_color: WHITE,
icon_color: BLD_BG,
background_color: BLD_BG,
border_color: BLD_BG,
border_radius: RADIUS,
border_width: 0,
},
active: &ButtonStyle {
font: Font::BOLD,
@ -87,9 +84,6 @@ pub fn button_confirm() -> ButtonStyleSheet {
button_color: BLD_INSTALL_BTN_COLOR_ACTIVE,
icon_color: BLD_BG,
background_color: BLD_BG,
border_color: BLD_BG,
border_radius: RADIUS,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::BOLD,
@ -97,9 +91,6 @@ pub fn button_confirm() -> ButtonStyleSheet {
button_color: GREY_DARK,
icon_color: BLD_BG,
background_color: FG,
border_color: FG,
border_radius: RADIUS,
border_width: 0,
},
}
}
@ -112,9 +103,6 @@ pub fn button_wipe_cancel() -> ButtonStyleSheet {
button_color: BLD_WIPE_CANCEL_BTN_COLOR,
icon_color: WHITE,
background_color: BLD_WIPE_COLOR,
border_color: BLD_WIPE_COLOR,
border_radius: RADIUS,
border_width: 0,
},
active: &ButtonStyle {
font: Font::BOLD,
@ -122,9 +110,6 @@ pub fn button_wipe_cancel() -> ButtonStyleSheet {
button_color: BLD_WIPE_CANCEL_BTN_COLOR_ACTIVE,
icon_color: WHITE,
background_color: BLD_WIPE_COLOR,
border_color: BLD_WIPE_COLOR,
border_radius: RADIUS,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::BOLD,
@ -132,9 +117,6 @@ pub fn button_wipe_cancel() -> ButtonStyleSheet {
button_color: GREY_DARK,
icon_color: GREY_LIGHT,
background_color: WHITE,
border_color: WHITE,
border_radius: RADIUS,
border_width: 0,
},
}
}
@ -147,9 +129,6 @@ pub fn button_wipe_confirm() -> ButtonStyleSheet {
button_color: BLD_WIPE_BTN_COLOR,
icon_color: BLD_WIPE_COLOR,
background_color: BLD_WIPE_COLOR,
border_color: BLD_WIPE_COLOR,
border_radius: RADIUS,
border_width: 0,
},
active: &ButtonStyle {
font: Font::BOLD,
@ -157,9 +136,6 @@ pub fn button_wipe_confirm() -> ButtonStyleSheet {
button_color: BLD_WIPE_BTN_COLOR_ACTIVE,
icon_color: BLD_WIPE_COLOR,
background_color: BLD_WIPE_COLOR,
border_color: BLD_WIPE_COLOR,
border_radius: RADIUS,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::BOLD,
@ -167,9 +143,6 @@ pub fn button_wipe_confirm() -> ButtonStyleSheet {
button_color: GREY_DARK,
icon_color: FG,
background_color: FG,
border_color: FG,
border_radius: RADIUS,
border_width: 0,
},
}
}
@ -182,9 +155,6 @@ pub fn button_bld_menu() -> ButtonStyleSheet {
button_color: BLD_BG,
icon_color: BLD_FG,
background_color: BLD_BG,
border_color: BLD_BTN_COLOR,
border_radius: 2,
border_width: 2,
},
active: &ButtonStyle {
font: Font::BOLD,
@ -192,9 +162,6 @@ pub fn button_bld_menu() -> ButtonStyleSheet {
button_color: BLD_BG,
icon_color: BLD_FG,
background_color: BLD_BG,
border_color: BLD_BTN_COLOR_ACTIVE,
border_radius: 2,
border_width: 2,
},
disabled: &ButtonStyle {
font: Font::BOLD,
@ -202,9 +169,6 @@ pub fn button_bld_menu() -> ButtonStyleSheet {
button_color: BLD_BG,
icon_color: GREY_LIGHT,
background_color: BLD_BG,
border_color: BLD_BG,
border_radius: 2,
border_width: 2,
},
}
}
@ -217,9 +181,6 @@ pub fn button_bld() -> ButtonStyleSheet {
button_color: BLD_BTN_COLOR,
icon_color: BLD_FG,
background_color: BLD_BG,
border_color: BLD_BG,
border_radius: 4,
border_width: 0,
},
active: &ButtonStyle {
font: Font::BOLD,
@ -227,9 +188,6 @@ pub fn button_bld() -> ButtonStyleSheet {
button_color: BLD_BTN_COLOR_ACTIVE,
icon_color: BLD_FG,
background_color: BLD_BG,
border_color: BLD_BG,
border_radius: 4,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::BOLD,
@ -237,9 +195,6 @@ pub fn button_bld() -> ButtonStyleSheet {
button_color: BLD_BTN_COLOR,
icon_color: GREY_LIGHT,
background_color: BLD_BG,
border_color: BLD_BG,
border_radius: 4,
border_width: 0,
},
}
}

@ -230,9 +230,6 @@ pub const fn button_default() -> ButtonStyleSheet {
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
active: &ButtonStyle {
font: Font::DEMIBOLD,
@ -240,9 +237,6 @@ pub const fn button_default() -> ButtonStyleSheet {
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: FG,
border_radius: RADIUS,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::DEMIBOLD,
@ -250,9 +244,6 @@ pub const fn button_default() -> ButtonStyleSheet {
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
}
}
@ -265,9 +256,6 @@ pub const fn button_warning_high() -> ButtonStyleSheet {
button_color: BG,
icon_color: ORANGE_DIMMED,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
active: &ButtonStyle {
font: Font::DEMIBOLD,
@ -275,9 +263,6 @@ pub const fn button_warning_high() -> ButtonStyleSheet {
button_color: BG,
icon_color: ORANGE_DIMMED,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::DEMIBOLD,
@ -285,9 +270,6 @@ pub const fn button_warning_high() -> ButtonStyleSheet {
button_color: BG,
icon_color: ORANGE_DIMMED,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
}
}
@ -300,9 +282,6 @@ pub const fn button_warning_low() -> ButtonStyleSheet {
button_color: BG,
icon_color: GREEN_LIME,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
active: &ButtonStyle {
font: Font::DEMIBOLD,
@ -310,9 +289,6 @@ pub const fn button_warning_low() -> ButtonStyleSheet {
button_color: BG,
icon_color: GREEN_LIME,
background_color: BG,
border_color: FG,
border_radius: RADIUS,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::DEMIBOLD,
@ -320,9 +296,6 @@ pub const fn button_warning_low() -> ButtonStyleSheet {
button_color: BG,
icon_color: GREEN_LIME,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
}
}
@ -336,9 +309,6 @@ pub const fn button_confirm() -> ButtonStyleSheet {
button_color: GREEN,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
active: &ButtonStyle {
font: Font::BOLD,
@ -346,9 +316,6 @@ pub const fn button_confirm() -> ButtonStyleSheet {
button_color: GREEN_DARK,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: FG,
border_radius: RADIUS,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::BOLD,
@ -356,9 +323,6 @@ pub const fn button_confirm() -> ButtonStyleSheet {
button_color: GREEN_DARK,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
}
}
@ -372,9 +336,6 @@ pub const fn button_cancel() -> ButtonStyleSheet {
button_color: RED,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
active: &ButtonStyle {
font: Font::BOLD,
@ -382,9 +343,6 @@ pub const fn button_cancel() -> ButtonStyleSheet {
button_color: RED_DARK,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: FG,
border_radius: RADIUS,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::BOLD,
@ -392,9 +350,6 @@ pub const fn button_cancel() -> ButtonStyleSheet {
button_color: RED,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
}
}
@ -412,9 +367,6 @@ pub const fn button_reset() -> ButtonStyleSheet {
button_color: YELLOW,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
active: &ButtonStyle {
font: Font::BOLD,
@ -422,9 +374,6 @@ pub const fn button_reset() -> ButtonStyleSheet {
button_color: YELLOW_DARK,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: FG,
border_radius: RADIUS,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::BOLD,
@ -432,9 +381,6 @@ pub const fn button_reset() -> ButtonStyleSheet {
button_color: YELLOW,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
}
}
@ -447,9 +393,6 @@ pub const fn button_pin() -> ButtonStyleSheet {
button_color: GREY_DARK,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
active: &ButtonStyle {
font: Font::MONO,
@ -457,9 +400,6 @@ pub const fn button_pin() -> ButtonStyleSheet {
button_color: GREY_MEDIUM,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: FG,
border_radius: RADIUS,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::MONO,
@ -467,9 +407,6 @@ pub const fn button_pin() -> ButtonStyleSheet {
button_color: BG, // so there is no "button" itself, just the text
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
}
}
@ -482,9 +419,6 @@ pub const fn button_pin_confirm() -> ButtonStyleSheet {
button_color: GREEN,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
active: &ButtonStyle {
font: Font::MONO,
@ -492,9 +426,6 @@ pub const fn button_pin_confirm() -> ButtonStyleSheet {
button_color: GREEN_DARK,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: FG,
border_radius: RADIUS,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::MONO,
@ -502,9 +433,6 @@ pub const fn button_pin_confirm() -> ButtonStyleSheet {
button_color: GREY_DARK,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
}
}
@ -517,9 +445,6 @@ pub const fn button_pin_autocomplete() -> ButtonStyleSheet {
button_color: GREY_DARK, // same as PIN buttons
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
active: &ButtonStyle {
font: Font::MONO,
@ -527,9 +452,6 @@ pub const fn button_pin_autocomplete() -> ButtonStyleSheet {
button_color: GREEN_DARK,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: FG,
border_radius: RADIUS,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::MONO,
@ -537,9 +459,6 @@ pub const fn button_pin_autocomplete() -> ButtonStyleSheet {
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
}
}
@ -552,9 +471,6 @@ pub const fn button_suggestion_confirm() -> ButtonStyleSheet {
button_color: GREEN,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
active: &ButtonStyle {
font: Font::MONO,
@ -562,9 +478,6 @@ pub const fn button_suggestion_confirm() -> ButtonStyleSheet {
button_color: GREEN_DARK,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: FG,
border_radius: RADIUS,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::MONO,
@ -572,9 +485,6 @@ pub const fn button_suggestion_confirm() -> ButtonStyleSheet {
button_color: GREY_DARK,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
}
}
@ -587,9 +497,6 @@ pub const fn button_suggestion_autocomplete() -> ButtonStyleSheet {
button_color: GREY_DARK, // same as PIN buttons
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
active: &ButtonStyle {
font: Font::MONO,
@ -597,9 +504,6 @@ pub const fn button_suggestion_autocomplete() -> ButtonStyleSheet {
button_color: GREEN_DARK,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: FG,
border_radius: RADIUS,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::MONO,
@ -607,9 +511,6 @@ pub const fn button_suggestion_autocomplete() -> ButtonStyleSheet {
button_color: BG,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
}
}
@ -622,9 +523,6 @@ pub const fn button_counter() -> ButtonStyleSheet {
button_color: GREY_DARK,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
active: &ButtonStyle {
font: Font::DEMIBOLD,
@ -632,9 +530,6 @@ pub const fn button_counter() -> ButtonStyleSheet {
button_color: GREY_MEDIUM,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: FG,
border_radius: RADIUS,
border_width: 0,
},
disabled: &ButtonStyle {
font: Font::DEMIBOLD,
@ -642,9 +537,6 @@ pub const fn button_counter() -> ButtonStyleSheet {
button_color: GREY_DARK,
icon_color: GREY_LIGHT,
background_color: BG,
border_color: BG,
border_radius: RADIUS,
border_width: 0,
},
}
}

Loading…
Cancel
Save