diff options
author | ClementTsang <clementjhtsang@gmail.com> | 2020-01-10 19:00:55 -0500 |
---|---|---|
committer | ClementTsang <clementjhtsang@gmail.com> | 2020-01-10 19:00:55 -0500 |
commit | c5855e7b0a64228aa6808a0580d8aa2f0801729a (patch) | |
tree | 224eea6b307be4b3e25ad4ce3a334a261b40b873 /src | |
parent | e0f9738f5f40e202433f058a68abab2dcb6e9c68 (diff) |
Bit of a hack, change back to non-percent based for disks to prevent some jumping entries
Diffstat (limited to 'src')
-rw-r--r-- | src/canvas.rs | 17 |
1 files changed, 9 insertions, 8 deletions
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<B: backend::Backend>( ) }); + 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<B: backend::Backend>( .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); } |