mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
clean up cosmetic bits on uptime rendering
This commit is contained in:
parent
1d27265d02
commit
a4d84ae290
1 changed files with 5 additions and 2 deletions
|
|
@ -171,9 +171,10 @@ fn xmain() -> ! {
|
||||||
// 0 150 150 200
|
// 0 150 150 200
|
||||||
// Feb 05 15:00 (00:06:23) xxxx 3.72V/-100mA/99%
|
// Feb 05 15:00 (00:06:23) xxxx 3.72V/-100mA/99%
|
||||||
const CPU_BAR_WIDTH: i16 = 50;
|
const CPU_BAR_WIDTH: i16 = 50;
|
||||||
let time_rect = Rectangle::new(
|
let time_rect = Rectangle::new_with_style(
|
||||||
Point::new(0, 0),
|
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(
|
let cpuload_rect = Rectangle::new_with_style(
|
||||||
Point::new(screensize.x / 2 - CPU_BAR_WIDTH / 2, 0),
|
Point::new(screensize.x / 2 - CPU_BAR_WIDTH / 2, 0),
|
||||||
|
|
@ -519,6 +520,8 @@ fn xmain() -> ! {
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // update the time field
|
{ // 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();
|
uptime_tv.clear_str();
|
||||||
if let Some(dt) = datetime {
|
if let Some(dt) = datetime {
|
||||||
write!(
|
write!(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue