From a4d84ae2906a61ce69a3ff7bc16580813dad1ef2 Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 25 Jan 2022 17:09:03 +0800 Subject: [PATCH] clean up cosmetic bits on uptime rendering --- services/status/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/status/src/main.rs b/services/status/src/main.rs index 5635987d1..bc98595ab 100644 --- a/services/status/src/main.rs +++ b/services/status/src/main.rs @@ -171,9 +171,10 @@ fn xmain() -> ! { // 0 150 150 200 // Feb 05 15:00 (00:06:23) xxxx 3.72V/-100mA/99% const CPU_BAR_WIDTH: i16 = 50; - let time_rect = Rectangle::new( + let time_rect = Rectangle::new_with_style( Point::new(0, 0), - Point::new(screensize.x / 2 - CPU_BAR_WIDTH / 2 - 1, screensize.y / 2 - 1) + Point::new(screensize.x / 2 - CPU_BAR_WIDTH / 2 - 1, screensize.y / 2 - 1), + DrawStyle::new(PixelColor::Light, PixelColor::Light, 0) ); let cpuload_rect = Rectangle::new_with_style( Point::new(screensize.x / 2 - CPU_BAR_WIDTH / 2, 0), @@ -519,6 +520,8 @@ fn xmain() -> ! { } { // update the time field + // have to clear the entire rectangle area, because the text has a variable width and dirty text will remain if the text is shortened + gam.draw_rectangle(status_gid, time_rect).ok(); uptime_tv.clear_str(); if let Some(dt) = datetime { write!(