1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 06:48:16 +00:00

fix(core/rust): fix flickering in UI2 hold to confirm screen

[no changelog]
This commit is contained in:
tychovrahe 2022-09-21 11:28:54 +02:00 committed by TychoVrahe
parent 4bed278e80
commit a4d0ec3926

View File

@ -17,7 +17,7 @@ pub enum HoldToConfirmMsg<T> {
pub struct HoldToConfirm<T> { pub struct HoldToConfirm<T> {
loader: Loader, loader: Loader,
content: Child<T>, content: Child<T>,
buttons: FixedHeightBar<CancelHold>, buttons: Child<FixedHeightBar<CancelHold>>,
pad: Pad, pad: Pad,
} }
@ -29,7 +29,7 @@ where
Self { Self {
loader: Loader::new(), loader: Loader::new(),
content: Child::new(content), content: Child::new(content),
buttons: CancelHold::new(), buttons: Child::new(CancelHold::new()),
pad: Pad::with_background(theme::BG), pad: Pad::with_background(theme::BG),
} }
} }
@ -113,8 +113,8 @@ where
} }
pub struct CancelHold { pub struct CancelHold {
cancel: Option<Button<&'static str>>, cancel: Option<Child<Button<&'static str>>>,
hold: Button<&'static str>, hold: Child<Button<&'static str>>,
} }
pub enum CancelHoldMsg { pub enum CancelHoldMsg {
@ -125,15 +125,19 @@ pub enum CancelHoldMsg {
impl CancelHold { impl CancelHold {
pub fn new() -> FixedHeightBar<Self> { pub fn new() -> FixedHeightBar<Self> {
theme::button_bar(Self { theme::button_bar(Self {
cancel: Some(Button::with_icon(theme::ICON_CANCEL)), cancel: Some(Button::with_icon(theme::ICON_CANCEL).into_child()),
hold: Button::with_text("HOLD TO CONFIRM").styled(theme::button_confirm()), hold: Button::with_text("HOLD TO CONFIRM")
.styled(theme::button_confirm())
.into_child(),
}) })
} }
pub fn without_cancel() -> FixedHeightBar<Self> { pub fn without_cancel() -> FixedHeightBar<Self> {
theme::button_bar(Self { theme::button_bar(Self {
cancel: None, cancel: None,
hold: Button::with_text("HOLD TO CONFIRM").styled(theme::button_confirm()), hold: Button::with_text("HOLD TO CONFIRM")
.styled(theme::button_confirm())
.into_child(),
}) })
} }
} }