diff --git a/src/help_window.rs b/src/help_window.rs index 4d9296c..edd7f48 100644 --- a/src/help_window.rs +++ b/src/help_window.rs @@ -14,50 +14,50 @@ impl HelpWindow { } pub fn render(&self, frame: &mut impl FrameWrapperInterface, area: Rect) { - let block = Block::default() - .title("Help") - .borders(Borders::ALL) - .style(Style::default().fg(Color::White).bg(Color::Black)); - - let inner_area = block.inner(area); - - let chunks = Layout::default() - .direction(Direction::Vertical) - .constraints([ - Constraint::Length(1), - Constraint::Length(1), - Constraint::Length(1), - Constraint::Length(1), - Constraint::Length(1), - Constraint::Length(1), - Constraint::Length(1), - Constraint::Length(1), - ]) - .split(inner_area); - - let help_text = vec![ - "Navigation:", - "s - Start/unpause the test", - "Esc - Pause the test", - "q - Quit", - "", - "Configuration:", - "--duration - Set test duration", - "--numbers - Include numbers in the test", - "--uppercase - Include uppercase letters", - "Run 'donkeytype help' for more options", - ]; - - // Render Clear widget first - frame.render_widget(Clear, area); - - // Render block - frame.render_widget(block, area); - - // Render text paragraphs - for (i, &text) in help_text.iter().enumerate() { - let paragraph = Paragraph::new(text).style(Style::default().fg(Color::White)); - frame.render_widget(paragraph, chunks[i]); - } + let block = Block::default() + .title("Help") + .borders(Borders::ALL) + .style(Style::default().fg(Color::White).bg(Color::Black)); + + let inner_area = block.inner(area); + + let chunks = Layout::default() + .direction(Direction::Vertical) + .constraints([ + Constraint::Length(1), + Constraint::Length(1), + Constraint::Length(1), + Constraint::Length(1), + Constraint::Length(1), + Constraint::Length(1), + Constraint::Length(1), + Constraint::Length(1), + ]) + .split(inner_area); + + let help_text = vec![ + "Navigation:", + "s - Start/unpause the test", + "Esc - Pause the test", + "q - Quit", + "", + "Configuration:", + "--duration - Set test duration", + "--numbers - Include numbers in the test", + "--uppercase - Include uppercase letters", + "Run 'donkeytype help' for more options", + ]; + + // Render Clear widget first + frame.render_widget(Clear, area); + + // Render block + frame.render_widget(block, area); + + // Render text paragraphs + for (i, &text) in help_text.iter().enumerate() { + let paragraph = Paragraph::new(text).style(Style::default().fg(Color::White)); + frame.render_widget(paragraph, chunks[i]); } + } }