From d790354667939143c65cbcbbb0508387ad33420c Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Wed, 28 Feb 2024 23:07:03 +0100 Subject: [PATCH] fix(core): workaround umlauts not being cleared [no changelog] --- .../rust/src/ui/model_tt/component/loader.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/core/embed/rust/src/ui/model_tt/component/loader.rs b/core/embed/rust/src/ui/model_tt/component/loader.rs index 20eac60466..d661653b71 100644 --- a/core/embed/rust/src/ui/model_tt/component/loader.rs +++ b/core/embed/rust/src/ui/model_tt/component/loader.rs @@ -32,6 +32,7 @@ pub struct Loader { growing_duration: Duration, shrinking_duration: Duration, styles: LoaderStyleSheet, + offset_y: i16, } impl Loader { @@ -54,6 +55,7 @@ impl Loader { growing_duration: Duration::from_millis(GROWING_DURATION_MS), shrinking_duration: Duration::from_millis(SHRINKING_DURATION_MS), styles, + offset_y: 0, } } @@ -140,7 +142,15 @@ impl Component for Loader { type Msg = LoaderMsg; fn place(&mut self, bounds: Rect) -> Rect { - self.pad.place(bounds); + // Current loader API only takes Y-offset relative to screen center, which we + // compute from the bounds center point. + let screen_center = constant::screen().center(); + self.offset_y = bounds.center().y - screen_center.y; + + // FIXME: avoid umlauts rendering outside bounds + let mut bounds_up_to_top = bounds; + bounds_up_to_top.y0 = 0; + self.pad.place(bounds_up_to_top); Rect::from_center_and_size(bounds.center(), Self::SIZE) } @@ -182,15 +192,10 @@ impl Component for Loader { self.styles.active }; - // Current loader API only takes Y-offset relative to screen center, which we - // compute from the bounds center point. - let screen_center = constant::screen().center(); - let offset_y = self.pad.area.center().y - screen_center.y; - self.pad.paint(); display::loader( progress, - offset_y, + self.offset_y, style.loader_color, style.background_color, style.icon,