1
0
mirror of https://github.com/danog/ytop.git synced 2024-11-26 20:15:03 +01:00

Temporarily fix table width bug

This commit is contained in:
Caleb Bassi 2020-01-13 10:50:53 -08:00
parent cb9d508254
commit 851b61e0a9
2 changed files with 16 additions and 9 deletions

View File

@ -130,14 +130,20 @@ impl Widget for DiskWidget<'_> {
)
.block(block::new(self.colorscheme, &self.title))
.header_style(self.colorscheme.text.modifier(Modifier::BOLD))
.widths(&[
Constraint::Min(5),
Constraint::Min(5),
Constraint::Length(5),
Constraint::Length(8),
Constraint::Length(8),
Constraint::Length(8),
])
.widths(&if area.width > 55 {
vec![
// Constraint::Min(5),
// Constraint::Min(5),
Constraint::Length(u16::max((area.width as i16 - 2 - 50) as u16, 5)),
Constraint::Length(u16::max((area.width as i16 - 2 - 50) as u16, 5)),
Constraint::Length(5),
Constraint::Length(8),
Constraint::Length(8),
Constraint::Length(8),
]
} else {
vec![Constraint::Length(5), Constraint::Length(5)]
})
.column_spacing(1)
.header_gap(0)
.draw(area, buf);

View File

@ -118,7 +118,8 @@ impl Widget for ProcWidget<'_> {
.header_style(self.colorscheme.text.modifier(Modifier::BOLD))
.widths(&[
Constraint::Length(5),
Constraint::Min(5),
// Constraint::Min(5),
Constraint::Length(u16::max((area.width as i16 - 2 - 18) as u16, 5)),
Constraint::Length(5),
Constraint::Length(5),
])