Skip to content

Commit

Permalink
update inspection section layout
Browse files Browse the repository at this point in the history
  • Loading branch information
pythops committed Oct 2, 2024
1 parent b0fa6f4 commit 7cad371
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions oryx-tui/src/section/inspection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,25 @@ impl Inspection {
if fuzzy.is_enabled() {
let chunks = Layout::default()
.direction(Direction::Vertical)
.constraints([Constraint::Fill(1), Constraint::Length(3)])
.constraints([
Constraint::Length(1),
Constraint::Fill(1),
Constraint::Length(3),
])
.horizontal_margin(1)
.split(block);
(chunks[0], chunks[1])
(chunks[1], chunks[2])
} else {
let chunks = Layout::default()
.direction(Direction::Vertical)
.constraints([Constraint::Fill(1), Constraint::Length(1)])
.constraints([
Constraint::Length(1),
Constraint::Fill(1),
Constraint::Length(1),
])
.horizontal_margin(1)
.split(block);
(chunks[0], chunks[1])
(chunks[1], chunks[2])
}
};

Expand Down Expand Up @@ -485,7 +493,7 @@ impl Inspection {
.flex(Flex::SpaceBetween)
.highlight_style(Style::new().bg(ratatui::style::Color::DarkGray))
.highlight_spacing(HighlightSpacing::Always)
.block(Block::default().padding(Padding::top(2)));
.block(Block::default().padding(Padding::uniform(1)));

if fuzzy.is_enabled() {
frame.render_stateful_widget(table, packet_block, &mut fuzzy.scroll_state);
Expand Down Expand Up @@ -544,6 +552,7 @@ impl Inspection {
Block::new()
.borders(Borders::TOP)
.title(" Search  ")
.padding(Padding::horizontal(1))
.title_style({
if fuzzy.is_paused() {
Style::default().bold().yellow()
Expand Down

0 comments on commit 7cad371

Please sign in to comment.