Make it clear what rects we are using for extra blank rects

This commit is contained in:
Kovid Goyal 2021-09-23 16:19:12 +05:30
parent f6a6ead0f3
commit f3b601aa06
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 5 deletions

View File

@ -3,7 +3,6 @@
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from enum import IntFlag
from itertools import chain
from typing import Sequence, Tuple
from .fast_data_types import (
@ -72,7 +71,7 @@ class Borders:
self,
all_windows: WindowList,
current_layout: LayoutType,
extra_blank_rects: Sequence[Tuple[int, int, int, int]],
tab_bar_rects: Sequence[Tuple[int, int, int, int]],
draw_window_borders: bool = True,
) -> None:
opts = get_options()
@ -81,9 +80,12 @@ class Borders:
add_borders_rect(self.os_window_id, self.tab_id, 0, 0, 0, 0, BorderColor.default_bg)
has_background_image = os_window_has_background_image(self.os_window_id)
if not has_background_image:
for br in chain(current_layout.blank_rects, extra_blank_rects):
for br in current_layout.blank_rects:
left, top, right, bottom = br
add_borders_rect(self.os_window_id, self.tab_id, left, top, right, bottom, BorderColor.default_bg)
for tbr in tab_bar_rects:
left, top, right, bottom = tbr
add_borders_rect(self.os_window_id, self.tab_id, left, top, right, bottom, BorderColor.default_bg)
bw = 0
groups = tuple(all_windows.iter_all_layoutable_groups(only_visible=True))
if groups:

View File

@ -222,7 +222,7 @@ class Tab: # {{{
ly = self.current_layout
self.borders(
all_windows=self.windows,
current_layout=ly, extra_blank_rects=tm.blank_rects,
current_layout=ly, tab_bar_rects=tm.tab_bar_rects,
draw_window_borders=(ly.needs_window_borders and self.windows.num_visble_groups > 1) or ly.must_draw_borders
)
if w is not None:
@ -935,7 +935,7 @@ class TabManager: # {{{
self.set_active_tab_idx(i)
@property
def blank_rects(self) -> Tuple[Rect, ...]:
def tab_bar_rects(self) -> Tuple[Rect, ...]:
return self.tab_bar.blank_rects if self.tab_bar_should_be_visible else ()
def destroy(self) -> None: