1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-27 00:28:10 +00:00

fix(core): workaround umlauts not being cleared

[no changelog]

(cherry picked from commit d790354667)
This commit is contained in:
Martin Milata 2024-02-28 23:07:03 +01:00
parent 1fddb0b498
commit 6ae158cac9

View File

@ -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,