From 47acf1667d98c939c58e763a726e6b767ca1ebad Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Sun, 24 Jul 2016 23:03:59 -0700 Subject: [PATCH] Remove brackets from progress bar It was ugly, really. Put a Panel (doesn't exist yet) around it if you want. --- src/view/progress_bar.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/view/progress_bar.rs b/src/view/progress_bar.rs index ef49d28..99eabd2 100644 --- a/src/view/progress_bar.rs +++ b/src/view/progress_bar.rs @@ -80,18 +80,13 @@ impl ProgressBar { impl View for ProgressBar { fn draw(&self, printer: &Printer) { - // TODO: make the brackets an option - // (Or a theme property? Or both?) - printer.print((0, 0), "["); - printer.print((printer.size.x - 1, 0), "]"); - // Now, the bar itself... - let available = printer.size.x - 2; + let available = printer.size.x; let value = self.value.load(Ordering::Relaxed); let length = (available * (value - self.min)) / (self.max - self.min); printer.with_color(ColorStyle::Highlight, |printer| { - printer.print_hline((1, 0), length, " "); + printer.print_hline((0, 0), length, " "); }); }