fix(tui): Make client bottom layouts visible again (#2368)

The length constraint on the bottom areas was set to 0 and thus those two blocks were invisible.
We adjusted those to the correct values to show all lines & also removed the unnecessary extra chunk layout variable.
This commit is contained in:
saibotk 2024-07-09 16:27:48 +02:00 committed by GitHub
parent 571c4c111e
commit 40f9cc946c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -278,7 +278,7 @@ impl TuiUI {
let left_top_layout = Layout::default() let left_top_layout = Layout::default()
.direction(Direction::Vertical) .direction(Direction::Vertical)
.constraints([Constraint::Length(6), Constraint::Length(0)].as_ref()) .constraints([Constraint::Length(6), Constraint::Length(5)].as_ref())
.split(left_layout[0]); .split(left_layout[0]);
let left_bottom_layout = left_top_layout[1]; let left_bottom_layout = left_top_layout[1];
self.draw_process_timing_text(f, app, left_top_layout[0], false); self.draw_process_timing_text(f, app, left_top_layout[0], false);
@ -286,7 +286,7 @@ impl TuiUI {
let right_top_layout = Layout::default() let right_top_layout = Layout::default()
.direction(Direction::Vertical) .direction(Direction::Vertical)
.constraints([Constraint::Length(7), Constraint::Length(0)].as_ref()) .constraints([Constraint::Length(7), Constraint::Length(5)].as_ref())
.split(right_layout); .split(right_layout);
let right_bottom_layout = right_top_layout[1]; let right_bottom_layout = right_top_layout[1];
self.draw_item_geometry_text(f, app, right_top_layout[0], false); self.draw_item_geometry_text(f, app, right_top_layout[0], false);
@ -646,10 +646,6 @@ impl TuiUI {
] ]
}; };
let chunks = Layout::default()
.constraints([Constraint::Percentage(100)].as_ref())
.split(area);
let table = Table::default() let table = Table::default()
.rows(items) .rows(items)
.block( .block(
@ -663,7 +659,7 @@ impl TuiUI {
.borders(Borders::ALL), .borders(Borders::ALL),
) )
.widths([Constraint::Ratio(1, 2), Constraint::Ratio(1, 2)]); .widths([Constraint::Ratio(1, 2), Constraint::Ratio(1, 2)]);
f.render_widget(table, chunks[0]); f.render_widget(table, area);
} }
fn draw_client_generic_text( fn draw_client_generic_text(
@ -702,10 +698,6 @@ impl TuiUI {
] ]
}; };
let chunks = Layout::default()
.constraints([Constraint::Percentage(100)].as_ref())
.split(area);
let table = Table::default() let table = Table::default()
.rows(items) .rows(items)
.block( .block(
@ -719,7 +711,7 @@ impl TuiUI {
.borders(Borders::ALL), .borders(Borders::ALL),
) )
.widths([Constraint::Ratio(1, 2), Constraint::Ratio(1, 2)]); .widths([Constraint::Ratio(1, 2), Constraint::Ratio(1, 2)]);
f.render_widget(table, chunks[0]); f.render_widget(table, area);
} }
#[cfg(feature = "introspection")] #[cfg(feature = "introspection")]