mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-22 21:24:49 +02:00
Fix too small window bug
This commit is contained in:
parent
1b09133e3b
commit
96bb4d1dc1
@ -741,7 +741,7 @@ fn draw_temp_table<B: backend::Backend>(
|
|||||||
) {
|
) {
|
||||||
let temp_sensor_data: &[Vec<String>] = &(app_state.canvas_data.temp_sensor_data);
|
let temp_sensor_data: &[Vec<String>] = &(app_state.canvas_data.temp_sensor_data);
|
||||||
|
|
||||||
let num_rows = u64::from(draw_loc.height) - 5;
|
let num_rows = max(0, i64::from(draw_loc.height) - 5) as u64;
|
||||||
let start_position = get_start_position(
|
let start_position = get_start_position(
|
||||||
num_rows,
|
num_rows,
|
||||||
&(app_state.scroll_direction),
|
&(app_state.scroll_direction),
|
||||||
@ -807,7 +807,7 @@ fn draw_disk_table<B: backend::Backend>(
|
|||||||
f: &mut Frame<B>, app_state: &mut app::App, draw_loc: Rect,
|
f: &mut Frame<B>, app_state: &mut app::App, draw_loc: Rect,
|
||||||
) {
|
) {
|
||||||
let disk_data: &[Vec<String>] = &(app_state.canvas_data.disk_data);
|
let disk_data: &[Vec<String>] = &(app_state.canvas_data.disk_data);
|
||||||
let num_rows = u64::from(draw_loc.height) - 5;
|
let num_rows = max(0, i64::from(draw_loc.height) - 5) as u64;
|
||||||
let start_position = get_start_position(
|
let start_position = get_start_position(
|
||||||
num_rows,
|
num_rows,
|
||||||
&(app_state.scroll_direction),
|
&(app_state.scroll_direction),
|
||||||
@ -958,7 +958,7 @@ fn draw_processes_table<B: backend::Backend>(
|
|||||||
// hit the process we've currently scrolled to.
|
// hit the process we've currently scrolled to.
|
||||||
// We also need to move the list - we can
|
// We also need to move the list - we can
|
||||||
// do so by hiding some elements!
|
// do so by hiding some elements!
|
||||||
let num_rows = u64::from(draw_loc.height) - 5;
|
let num_rows = max(0, i64::from(draw_loc.height) - 5) as u64;
|
||||||
|
|
||||||
let position = get_start_position(
|
let position = get_start_position(
|
||||||
num_rows,
|
num_rows,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user