summaryrefslogtreecommitdiffstats
path: root/src/app
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2021-01-25 02:21:33 -0500
committerGitHub <noreply@github.com>2021-01-25 02:21:33 -0500
commitd48e6cd7e080432daeca54a0aff9271c60a45107 (patch)
treef37c9eb8f9b917b491a00b627ee807efe54d429e /src/app
parent9822478454c419ccc1d02ed11c9a2cafbfe78a02 (diff)
bug: Workaround for strange rendering when there are <4 CPU entries reported (#398)
So it seems that tui-rs doesn't like rendering my CPU bars if the height is exactly 1. It needs at least 2. I have no idea why, this is probably something weird with how I render. This, of course, breaks when there is only one row to report (i.e. with a dual core setup in #397). The workaround switches the gap between the CPU and mem/net parts to 0, and increases the CPU's draw height by 1, only when the height is otherwise 1 (so the draw height is now at least 2). This does have the side effect of including an extra line to the side borders, but I think it's fine.
Diffstat (limited to 'src/app')
-rw-r--r--src/app/data_harvester/cpu.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/app/data_harvester/cpu.rs b/src/app/data_harvester/cpu.rs
index c154cfa1..4bc4cb94 100644
--- a/src/app/data_harvester/cpu.rs
+++ b/src/app/data_harvester/cpu.rs
@@ -189,5 +189,6 @@ pub async fn get_cpu_data_list(
})
}
+ // Ok(Vec::from(cpu_deque.drain(0..5).collect::<Vec<_>>()))
Ok(Vec::from(cpu_deque))
}