Fix rendering on the header and status lines

This commit is contained in:
Carlos de Paula 2026-01-05 10:04:23 -03:00
parent d1b913dc31
commit 2657ff8f2e
No known key found for this signature in database

View file

@ -32,12 +32,18 @@ pub fn apply_pane_bg_no_vertical_borders(buf: &mut Buffer, pane: Rect, bg_color:
}
}
/// Apply background color to entire area
/// Apply background color to entire area, excluding header and status bar
#[inline]
pub fn apply_overall_bg(buf: &mut Buffer, area: Rect, bg_color: Color) {
for y in area.top()..area.bottom() {
for x in area.left()..area.right() {
buf[(x, y)].set_bg(bg_color);
// Skip the header (top row) and status bar (bottom row)
let start_y = area.top() + 1;
let end_y = if area.bottom() > 0 { area.bottom() - 1 } else { area.bottom() };
if start_y < end_y {
for y in start_y..end_y {
for x in area.left()..area.right() {
buf[(x, y)].set_bg(bg_color);
}
}
}
}