display tweaks
make it more pretty
This commit is contained in:
parent
1cb05d404b
commit
e51cdb0c50
@ -81,14 +81,23 @@ pub fn draw_disks(f: &mut ratatui::Frame<'_>, area: Rect, m: Option<&Metrics>) {
|
|||||||
pct
|
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);
|
let card = Block::default().borders(Borders::ALL).title(title);
|
||||||
f.render_widget(card, *slot);
|
f.render_widget(card, card_rect);
|
||||||
|
|
||||||
let inner_card = Rect {
|
let inner_card = Rect {
|
||||||
x: slot.x + 1,
|
x: card_rect.x + 1,
|
||||||
y: slot.y + 1,
|
y: card_rect.y + 1,
|
||||||
width: slot.width.saturating_sub(2),
|
width: card_rect.width.saturating_sub(2),
|
||||||
height: slot.height.saturating_sub(2),
|
height: card_rect.height.saturating_sub(2),
|
||||||
};
|
};
|
||||||
if inner_card.height == 0 {
|
if inner_card.height == 0 {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user