mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-03-03 16:56:07 +00:00
fix(core): fix delizia htc anim spurious start
[no changelog]
This commit is contained in:
parent
587b5e8eb8
commit
9ad68f9ce3
@ -181,7 +181,8 @@ impl HoldToConfirm {
|
||||
let button = Button::new(ButtonContent::Empty)
|
||||
.styled(theme::button_default())
|
||||
.with_long_press(Duration::from_millis(2200))
|
||||
.without_haptics();
|
||||
.without_haptics()
|
||||
.initially_enabled(false);
|
||||
Self {
|
||||
title: Label::new(
|
||||
TR::instructions__continue_holding.into(),
|
||||
@ -256,7 +257,21 @@ impl Component for HoldToConfirm {
|
||||
_ => (),
|
||||
}
|
||||
|
||||
if let Event::Timer(EventCtx::ANIM_FRAME_TIMER) = event {
|
||||
match event {
|
||||
Event::Attach(_) => {
|
||||
// Reset state on attach and disable button
|
||||
self.anim.reset();
|
||||
self.button.disable(ctx);
|
||||
ctx.request_anim_frame();
|
||||
ctx.request_paint();
|
||||
}
|
||||
Event::Timer(EventCtx::ANIM_FRAME_TIMER) => {
|
||||
// Handle animation frames
|
||||
if !self.button.is_enabled() && !self.anim.is_active() {
|
||||
self.button.enable(ctx);
|
||||
ctx.request_paint();
|
||||
}
|
||||
|
||||
if self.anim.is_active() {
|
||||
ctx.request_anim_frame();
|
||||
ctx.request_paint();
|
||||
@ -270,6 +285,8 @@ impl Component for HoldToConfirm {
|
||||
return Some(());
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user