Formatting
This commit is contained in:
parent
811743e1e4
commit
045e11cd63
1 changed files with 10 additions and 6 deletions
16
src/ui.rs
16
src/ui.rs
|
|
@ -110,7 +110,7 @@ fn render_bottom_bar(frame: &mut Frame, area: Rect, app: &App) {
|
||||||
let command_text = format!(" {}", commands.iter()
|
let command_text = format!(" {}", commands.iter()
|
||||||
.map(|(key, desc)| format!("{} ({})", key, desc))
|
.map(|(key, desc)| format!("{} ({})", key, desc))
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.join(" · "));
|
.join(" · "));
|
||||||
|
|
||||||
let command_area = if app.config.show_help_hint {
|
let command_area = if app.config.show_help_hint {
|
||||||
// Leave space for help hint
|
// Leave space for help hint
|
||||||
|
|
@ -151,7 +151,7 @@ fn render_help_command_bar(frame: &mut Frame) {
|
||||||
let command_text = format!(" {}", commands.iter()
|
let command_text = format!(" {}", commands.iter()
|
||||||
.map(|(key, desc)| format!("{} ({})", key, desc))
|
.map(|(key, desc)| format!("{} ({})", key, desc))
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.join(" · "));
|
.join(" · "));
|
||||||
|
|
||||||
let bar_area = Rect::new(
|
let bar_area = Rect::new(
|
||||||
0,
|
0,
|
||||||
|
|
@ -217,7 +217,8 @@ fn render_section(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_help(frame: &mut Frame, _app: &App) {
|
fn render_help(frame: &mut Frame, _app: &App) {
|
||||||
let area = centered_rect(60, frame.size().height.saturating_sub(2), frame.size());
|
let width = frame.size().width.saturating_sub(4).min(60);
|
||||||
|
let area = centered_rect(width, frame.size().height.saturating_sub(2), frame.size());
|
||||||
|
|
||||||
frame.render_widget(Clear, area);
|
frame.render_widget(Clear, area);
|
||||||
|
|
||||||
|
|
@ -255,14 +256,16 @@ fn render_help(frame: &mut Frame, _app: &App) {
|
||||||
|
|
||||||
let paragraph = Paragraph::new(text)
|
let paragraph = Paragraph::new(text)
|
||||||
.block(block)
|
.block(block)
|
||||||
.style(Style::default().fg(Color::White));
|
.style(Style::default().fg(Color::White))
|
||||||
|
.wrap(ratatui::widgets::Wrap { trim: true });
|
||||||
|
|
||||||
frame.render_widget(paragraph, area);
|
frame.render_widget(paragraph, area);
|
||||||
render_help_command_bar(frame);
|
render_help_command_bar(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_config_help(frame: &mut Frame, _app: &App) {
|
fn render_config_help(frame: &mut Frame, _app: &App) {
|
||||||
let area = centered_rect(60, frame.size().height.saturating_sub(2), frame.size());
|
let width = frame.size().width.saturating_sub(4).min(60);
|
||||||
|
let area = centered_rect(width, frame.size().height.saturating_sub(2), frame.size());
|
||||||
|
|
||||||
frame.render_widget(Clear, area);
|
frame.render_widget(Clear, area);
|
||||||
|
|
||||||
|
|
@ -291,7 +294,8 @@ fn render_config_help(frame: &mut Frame, _app: &App) {
|
||||||
|
|
||||||
let paragraph = Paragraph::new(text)
|
let paragraph = Paragraph::new(text)
|
||||||
.block(block)
|
.block(block)
|
||||||
.style(Style::default().fg(Color::White));
|
.style(Style::default().fg(Color::White))
|
||||||
|
.wrap(ratatui::widgets::Wrap { trim: true });
|
||||||
|
|
||||||
frame.render_widget(paragraph, area);
|
frame.render_widget(paragraph, area);
|
||||||
render_help_command_bar(frame);
|
render_help_command_bar(frame);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue