Begin change of legend, and fixed scrolling issue caused by tui-fork drop

This commit is contained in:
ClementTsang 2019-12-11 01:01:24 -05:00
parent f203da1ac5
commit 467af10c36
1 changed files with 22 additions and 3 deletions

View File

@ -103,6 +103,25 @@ pub fn draw_data<B: backend::Backend>(terminal: &mut Terminal<B>, app_state: &mu
.constraints([Constraint::Percentage(50), Constraint::Percentage(50)].as_ref())
.split(vertical_chunks[2]);
// Component specific chunks
let cpu_chunk = Layout::default()
.direction(Direction::Horizontal)
.margin(0)
.constraints([Constraint::Percentage(90), Constraint::Percentage(10)].as_ref())
.split(vertical_chunks[0]);
let mem_chunk = Layout::default()
.direction(Direction::Horizontal)
.margin(0)
.constraints([Constraint::Percentage(90), Constraint::Percentage(10)].as_ref())
.split(middle_chunks[0]);
let network_chunk = Layout::default()
.direction(Direction::Horizontal)
.margin(0)
.constraints([Constraint::Percentage(90), Constraint::Percentage(10)].as_ref())
.split(bottom_chunks[0]);
// Set up blocks and their components
// CPU usage graph
{
@ -226,7 +245,7 @@ pub fn draw_data<B: backend::Backend>(terminal: &mut Terminal<B>, app_state: &mu
// Temperature table
{
let num_rows = i64::from(middle_divided_chunk_2[0].height) - 3;
let num_rows = i64::from(middle_divided_chunk_2[0].height) - 4;
let start_position = get_start_position(
num_rows,
&(app_state.scroll_direction),
@ -270,7 +289,7 @@ pub fn draw_data<B: backend::Backend>(terminal: &mut Terminal<B>, app_state: &mu
// Disk usage table
{
let num_rows = i64::from(middle_divided_chunk_2[1].height) - 3;
let num_rows = i64::from(middle_divided_chunk_2[1].height) - 4;
let start_position = get_start_position(
num_rows,
&(app_state.scroll_direction),
@ -364,7 +383,7 @@ pub fn draw_data<B: backend::Backend>(terminal: &mut Terminal<B>, app_state: &mu
// * Show/hide elements based on scroll position
// As such, we use a process_counter to know when we've hit the process we've currently scrolled to. We also need to move the list - we can
// do so by hiding some elements!
let num_rows = i64::from(bottom_chunks[1].height) - 3;
let num_rows = i64::from(bottom_chunks[1].height) - 4;
let start_position = get_start_position(
num_rows,