Adjust look of progress window

This commit is contained in:
2Shirt 2025-05-31 14:42:35 -07:00
parent 718e4061f8
commit 88f1234dd0
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
3 changed files with 14 additions and 6 deletions

View file

@ -751,10 +751,10 @@ fn get_chunks(r: Rect) -> Vec<Rect> {
chunks.push(centered_rect(60, 25, r));
// Progress
chunks.push(centered_rect(60, 80, chunks[1]));
chunks.push(centered_rect(60, 70, r));
// Results
chunks.push(centered_rect(60, 80, chunks[1]));
chunks.push(centered_rect(60, 70, r));
// Done
chunks

View file

@ -16,7 +16,7 @@
use color_eyre::Result;
use ratatui::{
Frame,
layout::Rect,
layout::{Alignment, Rect},
style::{Color, Style, Stylize},
text::{Line, Span},
widgets::{Block, Borders, Clear, Paragraph},
@ -139,12 +139,19 @@ impl Component for Progress {
});
// Build block
let block = Block::default()
let outer_block = Block::default()
.borders(Borders::ALL)
.style(Style::default().bold());
let body = Paragraph::new(body_text).block(block);
let inner_block = Block::default()
.borders(Borders::NONE)
.style(Style::default().bold())
.title("Progress")
.title_alignment(Alignment::Center);
let inner = outer_block.inner(area);
let body = Paragraph::new(body_text).block(inner_block);
frame.render_widget(Clear, area);
frame.render_widget(body, area);
frame.render_widget(outer_block, area);
frame.render_widget(body, inner);
Ok(())
}
}

View file

@ -93,6 +93,7 @@ impl Component for Results {
}
fn draw(&mut self, frame: &mut Frame, rect: Rect) -> Result<()> {
return Ok(());
if !self.show {
return Ok(());
}