mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Fix rendering on the header and status lines
This commit is contained in:
parent
d1b913dc31
commit
2657ff8f2e
1 changed files with 10 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue