From a4d0ec3926607b54a15a712f2202f1a654a27607 Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Wed, 21 Sep 2022 11:28:54 +0200 Subject: [PATCH] fix(core/rust): fix flickering in UI2 hold to confirm screen [no changelog] --- .../ui/model_tt/component/hold_to_confirm.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/core/embed/rust/src/ui/model_tt/component/hold_to_confirm.rs b/core/embed/rust/src/ui/model_tt/component/hold_to_confirm.rs index 52775ccffd..1d280ddec8 100644 --- a/core/embed/rust/src/ui/model_tt/component/hold_to_confirm.rs +++ b/core/embed/rust/src/ui/model_tt/component/hold_to_confirm.rs @@ -17,7 +17,7 @@ pub enum HoldToConfirmMsg { pub struct HoldToConfirm { loader: Loader, content: Child, - buttons: FixedHeightBar, + buttons: Child>, pad: Pad, } @@ -29,7 +29,7 @@ where Self { loader: Loader::new(), content: Child::new(content), - buttons: CancelHold::new(), + buttons: Child::new(CancelHold::new()), pad: Pad::with_background(theme::BG), } } @@ -113,8 +113,8 @@ where } pub struct CancelHold { - cancel: Option>, - hold: Button<&'static str>, + cancel: Option>>, + hold: Child>, } pub enum CancelHoldMsg { @@ -125,15 +125,19 @@ pub enum CancelHoldMsg { impl CancelHold { pub fn new() -> FixedHeightBar { theme::button_bar(Self { - cancel: Some(Button::with_icon(theme::ICON_CANCEL)), - hold: Button::with_text("HOLD TO CONFIRM").styled(theme::button_confirm()), + cancel: Some(Button::with_icon(theme::ICON_CANCEL).into_child()), + hold: Button::with_text("HOLD TO CONFIRM") + .styled(theme::button_confirm()) + .into_child(), }) } pub fn without_cancel() -> FixedHeightBar { theme::button_bar(Self { 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(), }) } }