From 0ece9bde21a72a231445024df78ffca4b9bd41a6 Mon Sep 17 00:00:00 2001 From: John Doty Date: Sun, 30 Apr 2023 07:22:27 -0700 Subject: [PATCH] Remove explanation for what fwd does You probably know already, and it feels clunky here. --- src/client/ui.rs | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/src/client/ui.rs b/src/client/ui.rs index 5732833..2cb2a72 100644 --- a/src/client/ui.rs +++ b/src/client/ui.rs @@ -302,12 +302,11 @@ impl UI { Row::new(vec!["l", "Show fwd's logs"]), ]; - let help_intro = 4; let border_lines = 3; let help_popup_area = centered_rect( 65, - keybindings.len() as u16 + help_intro + border_lines, + keybindings.len() as u16 + border_lines, frame.size(), ); let inner_area = @@ -315,15 +314,6 @@ impl UI { let key_width = 7; let binding_width = inner_area.width.saturating_sub(key_width); - let constraints = vec![ - Constraint::Length(help_intro), - Constraint::Length(inner_area.height - help_intro), - ]; - let help_parts = Layout::default() - .direction(Direction::Vertical) - .constraints(constraints) - .split(inner_area); - let keybindings_widths = &[ Constraint::Length(key_width), Constraint::Length(binding_width), @@ -331,22 +321,10 @@ impl UI { let keybindings = Table::new(keybindings) .widths(keybindings_widths) .column_spacing(1) - .block(Block::default().title("Keys").borders(Borders::TOP)); - - let exp = Paragraph::new( - "fwd automatically listens for connections on the same ports\nas the target, and forwards connections on those ports to the\ntarget.", - ); - - // outer box - frame.render_widget(Clear, help_popup_area); //this clears out the background - let helpbox = Block::default().title("Help").borders(Borders::ALL); - frame.render_widget(helpbox, help_popup_area); - - // explanation - frame.render_widget(exp, help_parts[0]); + .block(Block::default().title("Keys").borders(Borders::ALL)); // keybindings - frame.render_widget(keybindings, help_parts[1]); + frame.render_widget(keybindings, inner_area); } fn render_logs(&mut self, frame: &mut Frame, size: Rect) {