Skip to content

Commit

Permalink
[chore] ran cargo fmt to format the help_window file
Browse files Browse the repository at this point in the history
  • Loading branch information
theghostmac committed Oct 26, 2024
1 parent 57d729b commit a002544
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions src/help_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <seconds> - 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 <seconds> - 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]);
}
}
}

0 comments on commit a002544

Please sign in to comment.