Skip to content

Commit

Permalink
fix(tui): Make client bottom layouts visible again (#2368)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
saibotk authored Jul 9, 2024
1 parent 571c4c1 commit 40f9cc9
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions libafl/src/monitors/tui/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,15 @@ impl TuiUI {

let left_top_layout = Layout::default()
.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]);
let left_bottom_layout = left_top_layout[1];
self.draw_process_timing_text(f, app, left_top_layout[0], false);
self.draw_client_generic_text(f, app, left_bottom_layout);

let right_top_layout = Layout::default()
.direction(Direction::Vertical)
.constraints([Constraint::Length(7), Constraint::Length(0)].as_ref())
.constraints([Constraint::Length(7), Constraint::Length(5)].as_ref())
.split(right_layout);
let right_bottom_layout = right_top_layout[1];
self.draw_item_geometry_text(f, app, right_top_layout[0], false);
Expand Down Expand Up @@ -646,10 +646,6 @@ impl TuiUI {
]
};

let chunks = Layout::default()
.constraints([Constraint::Percentage(100)].as_ref())
.split(area);

let table = Table::default()
.rows(items)
.block(
Expand All @@ -663,7 +659,7 @@ impl TuiUI {
.borders(Borders::ALL),
)
.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(
Expand Down Expand Up @@ -702,10 +698,6 @@ impl TuiUI {
]
};

let chunks = Layout::default()
.constraints([Constraint::Percentage(100)].as_ref())
.split(area);

let table = Table::default()
.rows(items)
.block(
Expand All @@ -719,7 +711,7 @@ impl TuiUI {
.borders(Borders::ALL),
)
.widths([Constraint::Ratio(1, 2), Constraint::Ratio(1, 2)]);
f.render_widget(table, chunks[0]);
f.render_widget(table, area);
}

#[cfg(feature = "introspection")]
Expand Down

0 comments on commit 40f9cc9

Please sign in to comment.