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)); chunks.push(centered_rect(60, 25, r));
// Progress // Progress
chunks.push(centered_rect(60, 80, chunks[1])); chunks.push(centered_rect(60, 70, r));
// Results // Results
chunks.push(centered_rect(60, 80, chunks[1])); chunks.push(centered_rect(60, 70, r));
// Done // Done
chunks chunks

View file

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

View file

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