mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-24 15:28:10 +00:00
chore(core): remove unused mercury ButtonContent
[no changelog]
This commit is contained in:
parent
9b7ce3c84f
commit
e19138cdc8
@ -71,10 +71,6 @@ impl Button {
|
|||||||
Self::new(ButtonContent::IconAndText(content))
|
Self::new(ButtonContent::IconAndText(content))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn with_icon_blend(bg: Icon, fg: Icon, fg_offset: Offset) -> Self {
|
|
||||||
Self::new(ButtonContent::IconBlend(bg, fg, fg_offset))
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const fn empty() -> Self {
|
pub const fn empty() -> Self {
|
||||||
Self::new(ButtonContent::Empty)
|
Self::new(ButtonContent::Empty)
|
||||||
}
|
}
|
||||||
@ -181,13 +177,8 @@ impl Button {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn paint_background(&self, style: &ButtonStyle) {
|
pub fn paint_background(&self, style: &ButtonStyle) {
|
||||||
match &self.content {
|
|
||||||
ButtonContent::IconBlend(_, _, _) => {}
|
|
||||||
_ => {
|
|
||||||
display::rect_fill(self.area, style.button_color);
|
display::rect_fill(self.area, style.button_color);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn render_background<'s>(
|
pub fn render_background<'s>(
|
||||||
&self,
|
&self,
|
||||||
@ -195,9 +186,6 @@ impl Button {
|
|||||||
style: &ButtonStyle,
|
style: &ButtonStyle,
|
||||||
alpha: u8,
|
alpha: u8,
|
||||||
) {
|
) {
|
||||||
match &self.content {
|
|
||||||
ButtonContent::IconBlend(_, _, _) => {}
|
|
||||||
_ => {
|
|
||||||
if self.radius.is_some() {
|
if self.radius.is_some() {
|
||||||
shape::Bar::new(self.area)
|
shape::Bar::new(self.area)
|
||||||
.with_bg(style.background_color)
|
.with_bg(style.background_color)
|
||||||
@ -214,8 +202,6 @@ impl Button {
|
|||||||
.render(target);
|
.render(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn paint_content(&self, style: &ButtonStyle) {
|
pub fn paint_content(&self, style: &ButtonStyle) {
|
||||||
match &self.content {
|
match &self.content {
|
||||||
@ -243,12 +229,6 @@ impl Button {
|
|||||||
ButtonContent::IconAndText(child) => {
|
ButtonContent::IconAndText(child) => {
|
||||||
child.paint(self.area, self.style(), Self::BASELINE_OFFSET);
|
child.paint(self.area, self.style(), Self::BASELINE_OFFSET);
|
||||||
}
|
}
|
||||||
ButtonContent::IconBlend(bg, fg, offset) => display::icon_over_icon(
|
|
||||||
Some(self.area),
|
|
||||||
(*bg, Offset::zero(), style.button_color),
|
|
||||||
(*fg, *offset, style.text_color),
|
|
||||||
style.background_color,
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,20 +274,6 @@ impl Button {
|
|||||||
alpha,
|
alpha,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
ButtonContent::IconBlend(bg, fg, offset) => {
|
|
||||||
shape::Bar::new(self.area)
|
|
||||||
.with_bg(style.background_color)
|
|
||||||
.with_alpha(alpha)
|
|
||||||
.render(target);
|
|
||||||
shape::ToifImage::new(self.area.top_left(), bg.toif)
|
|
||||||
.with_fg(style.button_color)
|
|
||||||
.with_alpha(alpha)
|
|
||||||
.render(target);
|
|
||||||
shape::ToifImage::new(self.area.top_left() + *offset, fg.toif)
|
|
||||||
.with_fg(style.icon_color)
|
|
||||||
.with_alpha(alpha)
|
|
||||||
.render(target);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -452,7 +418,6 @@ impl crate::trace::Trace for Button {
|
|||||||
t.string("text", content.text);
|
t.string("text", content.text);
|
||||||
t.bool("icon", true);
|
t.bool("icon", true);
|
||||||
}
|
}
|
||||||
ButtonContent::IconBlend(_, _, _) => t.bool("icon", true),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -471,7 +436,6 @@ pub enum ButtonContent {
|
|||||||
Text(TString<'static>),
|
Text(TString<'static>),
|
||||||
Icon(Icon),
|
Icon(Icon),
|
||||||
IconAndText(IconText),
|
IconAndText(IconText),
|
||||||
IconBlend(Icon, Icon, Offset),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||||
|
@ -169,7 +169,6 @@ impl PassphraseKeyboard {
|
|||||||
ButtonContent::Icon(_) => " ".into(),
|
ButtonContent::Icon(_) => " ".into(),
|
||||||
ButtonContent::IconAndText(_) => " ".into(),
|
ButtonContent::IconAndText(_) => " ".into(),
|
||||||
ButtonContent::Empty => "".into(),
|
ButtonContent::Empty => "".into(),
|
||||||
ButtonContent::IconBlend(_, _, _) => "".into(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user