This commit is contained in:
sxyazi 2024-01-19 13:22:08 +08:00
parent dddf432f1c
commit c7ec9cceff
No known key found for this signature in database

View file

@ -25,13 +25,9 @@ impl Widget for Which<'_> {
} }
} }
let height = cands.0.len() as u16 + 2; let height = area.height.min(cands.0.len() as u16 + 2);
let area = Rect { let y = area.height.saturating_sub(height + 2);
x: 1, let area = Rect { x: area.width.min(1), y, width: area.width.saturating_sub(2), height };
y: area.height.saturating_sub(height + 2),
width: area.width.saturating_sub(2),
height,
};
let chunks = layout::Layout::new(Direction::Horizontal, [ let chunks = layout::Layout::new(Direction::Horizontal, [
Constraint::Ratio(1, 3), Constraint::Ratio(1, 3),