Adjust look of progress window
This commit is contained in:
parent
718e4061f8
commit
88f1234dd0
3 changed files with 14 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue