mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-22 21:24:49 +02:00
Begin change of legend, and fixed scrolling issue caused by tui-fork drop
This commit is contained in:
parent
f203da1ac5
commit
467af10c36
@ -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())
|
.constraints([Constraint::Percentage(50), Constraint::Percentage(50)].as_ref())
|
||||||
.split(vertical_chunks[2]);
|
.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
|
// Set up blocks and their components
|
||||||
// CPU usage graph
|
// CPU usage graph
|
||||||
{
|
{
|
||||||
@ -226,7 +245,7 @@ pub fn draw_data<B: backend::Backend>(terminal: &mut Terminal<B>, app_state: &mu
|
|||||||
|
|
||||||
// Temperature table
|
// 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(
|
let start_position = get_start_position(
|
||||||
num_rows,
|
num_rows,
|
||||||
&(app_state.scroll_direction),
|
&(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
|
// 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(
|
let start_position = get_start_position(
|
||||||
num_rows,
|
num_rows,
|
||||||
&(app_state.scroll_direction),
|
&(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
|
// * 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
|
// 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!
|
// 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(
|
let start_position = get_start_position(
|
||||||
num_rows,
|
num_rows,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user