Avoid exception when generating minimal borders for empty tab in tall/vertical layouts
This commit is contained in:
parent
430eaefc3e
commit
ad57467c93
@ -204,9 +204,12 @@ class Tall(Layout):
|
|||||||
|
|
||||||
def minimal_borders(self, all_windows: WindowList) -> Generator[BorderLine, None, None]:
|
def minimal_borders(self, all_windows: WindowList) -> Generator[BorderLine, None, None]:
|
||||||
num = all_windows.num_groups
|
num = all_windows.num_groups
|
||||||
if num == 1 or not lgd.draw_minimal_borders:
|
if num < 2 or not lgd.draw_minimal_borders:
|
||||||
return
|
return
|
||||||
|
try:
|
||||||
bw = next(all_windows.iter_all_layoutable_groups()).effective_border()
|
bw = next(all_windows.iter_all_layoutable_groups()).effective_border()
|
||||||
|
except StopIteration:
|
||||||
|
bw = 0
|
||||||
if not bw:
|
if not bw:
|
||||||
return
|
return
|
||||||
if num <= self.num_full_size_windows + 1:
|
if num <= self.num_full_size_windows + 1:
|
||||||
|
|||||||
@ -24,7 +24,10 @@ def borders(
|
|||||||
borders: List[BorderLine] = []
|
borders: List[BorderLine] = []
|
||||||
active_group = all_windows.active_group
|
active_group = all_windows.active_group
|
||||||
needs_borders_map = all_windows.compute_needs_borders_map(lgd.draw_active_borders)
|
needs_borders_map = all_windows.compute_needs_borders_map(lgd.draw_active_borders)
|
||||||
|
try:
|
||||||
bw = next(all_windows.iter_all_layoutable_groups()).effective_border()
|
bw = next(all_windows.iter_all_layoutable_groups()).effective_border()
|
||||||
|
except StopIteration:
|
||||||
|
bw = 0
|
||||||
if not bw:
|
if not bw:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -112,7 +115,7 @@ class Vertical(Layout):
|
|||||||
|
|
||||||
def minimal_borders(self, all_windows: WindowList) -> Generator[BorderLine, None, None]:
|
def minimal_borders(self, all_windows: WindowList) -> Generator[BorderLine, None, None]:
|
||||||
window_count = all_windows.num_groups
|
window_count = all_windows.num_groups
|
||||||
if window_count == 1 or not lgd.draw_minimal_borders:
|
if window_count < 2 or not lgd.draw_minimal_borders:
|
||||||
return
|
return
|
||||||
yield from borders(self.generate_layout_data(all_windows), self.main_is_horizontal, all_windows)
|
yield from borders(self.generate_layout_data(all_windows), self.main_is_horizontal, all_windows)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user