From 1f65d18fad3d63abb88c94f281614e6a4069e659 Mon Sep 17 00:00:00 2001 From: grdddj Date: Thu, 30 Mar 2023 19:10:03 +0200 Subject: [PATCH] rust: do not animate marquee in case animation_disabled --- core/embed/rust/src/ui/component/marquee.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/embed/rust/src/ui/component/marquee.rs b/core/embed/rust/src/ui/component/marquee.rs index d3559521d0..93b2eb6f9d 100644 --- a/core/embed/rust/src/ui/component/marquee.rs +++ b/core/embed/rust/src/ui/component/marquee.rs @@ -6,6 +6,7 @@ use crate::{ display, display::{Color, Font}, geometry::Rect, + util::animation_disabled, }, }; @@ -54,6 +55,11 @@ where } pub fn start(&mut self, ctx: &mut EventCtx, now: Instant) { + // Not starting if animations are disabled. + if animation_disabled() { + return; + } + if let State::Initial = self.state { let text_width = self.font.text_width(self.text.as_ref()); let max_offset = self.area.width() - text_width; @@ -150,6 +156,11 @@ where } fn event(&mut self, ctx: &mut EventCtx, event: Event) -> Option { + // Not doing anything if animations are disabled. + if animation_disabled() { + return None; + } + let now = Instant::now(); if let Event::Timer(token) = event {