From c5855e7b0a64228aa6808a0580d8aa2f0801729a Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Fri, 10 Jan 2020 19:00:55 -0500 Subject: [PATCH] Bit of a hack, change back to non-percent based for disks to prevent some jumping entries --- .vscode/settings.json | 35 ----------------------------------- src/canvas.rs | 17 +++++++++-------- 2 files changed, 9 insertions(+), 43 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index da1971ea..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "cSpell.words": [ - "AHHHHHH", - "Dataset", - "Ryzen", - "Tebibyte", - "avgcpu", - "backend", - "crossterm", - "curr", - "datasets", - "dword", - "fract", - "gotop", - "gtop", - "heim", - "iowait", - "keybinds", - "macos", - "minwindef", - "noheader", - "ntdef", - "processthreadsapi", - "rustop", - "softirq", - "stime", - "sysinfo", - "termion", - "utime", - "vangelis", - "winapi", - "winnt" - ], - "cSpell.language": "en,en-GB" -} diff --git a/src/canvas.rs b/src/canvas.rs index bc0eaef1..0add4b4f 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -726,6 +726,7 @@ fn draw_disk_table( ) }); + let width = f64::from(draw_loc.width); Table::new( ["Disk", "Mount", "Used", "Free", "Total", "R/s", "W/s"].iter(), disk_rows, @@ -745,14 +746,14 @@ fn draw_disk_table( .modifier(Modifier::BOLD), ) .widths(&[ - Constraint::Percentage(18), - Constraint::Percentage(14), - Constraint::Percentage(11), - Constraint::Percentage(11), - Constraint::Percentage(11), - Constraint::Percentage(11), - Constraint::Percentage(11), - Constraint::Percentage(11), + Constraint::Length((width * 0.18) as u16), + Constraint::Length((width * 0.14) as u16), + Constraint::Length((width * 0.11) as u16), + Constraint::Length((width * 0.11) as u16), + Constraint::Length((width * 0.11) as u16), + Constraint::Length((width * 0.11) as u16), + Constraint::Length((width * 0.11) as u16), + Constraint::Length((width * 0.11) as u16), ]) .render(f, draw_loc); }