progressbar: remove label
This commit is contained in:
parent
49365d3db4
commit
5eb831457b
@ -19,18 +19,9 @@ impl Progressbar {
|
|||||||
|
|
||||||
impl Widget for Progressbar {
|
impl Widget for Progressbar {
|
||||||
fn render(self, area: Rect, buf: &mut Buffer) {
|
fn render(self, area: Rect, buf: &mut Buffer) {
|
||||||
let label = Span::raw(format!(" {}% ", self.percentage));
|
|
||||||
let [h0, area] = Layout::horizontal([
|
|
||||||
Constraint::Length(label.width() as u16),
|
|
||||||
Constraint::Percentage(100),
|
|
||||||
])
|
|
||||||
.areas(area);
|
|
||||||
let [h1, h2] =
|
let [h1, h2] =
|
||||||
Layout::horizontal([Constraint::Percentage(self.percentage), Constraint::Fill(0)])
|
Layout::horizontal([Constraint::Percentage(self.percentage), Constraint::Fill(0)])
|
||||||
.areas(area);
|
.areas(area);
|
||||||
|
|
||||||
// label
|
|
||||||
label.render(h0, buf);
|
|
||||||
// done
|
// done
|
||||||
Span::from(line::THICK_HORIZONTAL.repeat(h1.width as usize)).render(h1, buf);
|
Span::from(line::THICK_HORIZONTAL.repeat(h1.width as usize)).render(h1, buf);
|
||||||
// rest
|
// rest
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user