display tweaks
Some checks failed
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled

make it more pretty
This commit is contained in:
jasonwitty 2025-10-06 12:05:12 -07:00
parent 1cb05d404b
commit e51cdb0c50

View File

@ -81,14 +81,23 @@ pub fn draw_disks(f: &mut ratatui::Frame<'_>, area: Rect, m: Option<&Metrics>) {
pct
);
// Indent the entire card (block) for partitions to align with └─ prefix (4 chars)
let card_indent = if d.is_partition { 4 } else { 0 };
let card_rect = Rect {
x: slot.x + card_indent,
y: slot.y,
width: slot.width.saturating_sub(card_indent),
height: slot.height,
};
let card = Block::default().borders(Borders::ALL).title(title);
f.render_widget(card, *slot);
f.render_widget(card, card_rect);
let inner_card = Rect {
x: slot.x + 1,
y: slot.y + 1,
width: slot.width.saturating_sub(2),
height: slot.height.saturating_sub(2),
x: card_rect.x + 1,
y: card_rect.y + 1,
width: card_rect.width.saturating_sub(2),
height: card_rect.height.saturating_sub(2),
};
if inner_card.height == 0 {
continue;