diff --git a/TODO.md b/TODO.md index 7399ca69..63ab701e 100644 --- a/TODO.md +++ b/TODO.md @@ -16,6 +16,8 @@ * Keybindings +* Legend gets in the way at too small of a height... maybe modify tui a bit more to fix this. + ## After making public * Tests diff --git a/src/canvas.rs b/src/canvas.rs index 10384472..afec5ba0 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -150,13 +150,13 @@ pub fn draw_data(terminal : &mut Terminal, app_sta .block(Block::default().title("Disk Usage").borders(Borders::ALL).border_style(border_style)) .header_style(Style::default().fg(Color::LightBlue).modifier(Modifier::BOLD)) .widths(&[ - (width * 0.18) as u16, - (width * 0.14) as u16, - (width * 0.13) as u16, - (width * 0.13) as u16, - (width * 0.13) as u16, - (width * 0.13) as u16, - (width * 0.13) as u16, + (width * 0.18).floor() as u16, + (width * 0.14).floor() as u16, + (width * 0.11).floor() as u16, + (width * 0.11).floor() as u16, + (width * 0.11).floor() as u16, + (width * 0.11).floor() as u16, + (width * 0.11).floor() as u16, ]) .render(&mut f, middle_divided_chunk_2[1]); } @@ -202,7 +202,7 @@ pub fn draw_data(terminal : &mut Terminal, app_sta if app_state.currently_selected_process_position < num_rows { 0 } - else if app_state.currently_selected_process_position - num_rows < app_state.previous_process_position { + else if app_state.currently_selected_process_position - num_rows <= app_state.previous_process_position { app_state.previous_process_position } else { diff --git a/src/convert_data.rs b/src/convert_data.rs index d802dfbd..14111a2e 100644 --- a/src/convert_data.rs +++ b/src/convert_data.rs @@ -67,7 +67,7 @@ pub fn update_disk_row(app_data : &data_collection::Data) -> Vec> { disk_vector.push(vec![ disk.name.to_string(), disk.mount_point.to_string(), - format!("{:.1}%", disk.used_space as f64 / disk.total_space as f64 * 100_f64), + format!("{:.0}%", disk.used_space as f64 / disk.total_space as f64 * 100_f64), if disk.free_space < 1024 { disk.free_space.to_string() + "MB" }