Better fix for minimal border layout issue
Keep _set_dimensions() private
This commit is contained in:
parent
bac6ebdf95
commit
02fb020dfd
@ -107,6 +107,6 @@ class Borders:
|
||||
draw_edges(self.os_window_id, self.tab_id, colors, wg)
|
||||
|
||||
if self.draw_minimal_borders:
|
||||
for border_line in current_layout.minimal_borders(all_windows):
|
||||
for border_line in current_layout.get_minimal_borders(all_windows):
|
||||
left, top, right, bottom = border_line.edges
|
||||
add_borders_rect(self.os_window_id, self.tab_id, left, top, right, bottom, border_line.color)
|
||||
|
||||
@ -218,7 +218,7 @@ class Layout:
|
||||
self.remove_all_biases()
|
||||
|
||||
def bias_increment_for_cell(self, is_horizontal: bool) -> float:
|
||||
self.set_dimensions()
|
||||
self._set_dimensions()
|
||||
if is_horizontal:
|
||||
return (lgd.cell_width + 1) / lgd.central.width
|
||||
return (lgd.cell_height + 1) / lgd.central.height
|
||||
@ -297,11 +297,11 @@ class Layout:
|
||||
is_visible = window is active_window or (is_group_leader and not self.only_active_window_visible)
|
||||
window.set_visible_in_layout(is_visible)
|
||||
|
||||
def set_dimensions(self) -> None:
|
||||
def _set_dimensions(self) -> None:
|
||||
lgd.central, tab_bar, vw, vh, lgd.cell_width, lgd.cell_height = viewport_for_window(self.os_window_id)
|
||||
|
||||
def __call__(self, all_windows: WindowList) -> None:
|
||||
self.set_dimensions()
|
||||
self._set_dimensions()
|
||||
self.update_visibility(all_windows)
|
||||
self.blank_rects = []
|
||||
self.do_layout(all_windows)
|
||||
@ -374,6 +374,10 @@ class Layout:
|
||||
def compute_needs_borders_map(self, all_windows: WindowList) -> Dict[int, bool]:
|
||||
return all_windows.compute_needs_borders_map(lgd.draw_active_borders)
|
||||
|
||||
def get_minimal_borders(self, windows: WindowList) -> Generator[BorderLine, None, None]:
|
||||
self._set_dimensions()
|
||||
yield from self.minimal_borders(windows)
|
||||
|
||||
def minimal_borders(self, windows: WindowList) -> Generator[BorderLine, None, None]:
|
||||
return
|
||||
yield BorderLine() # type: ignore
|
||||
|
||||
@ -204,7 +204,6 @@ class Tab: # {{{
|
||||
if tm is not None:
|
||||
w = self.active_window
|
||||
ly = self.current_layout
|
||||
ly.set_dimensions()
|
||||
self.borders(
|
||||
all_windows=self.windows,
|
||||
current_layout=ly, extra_blank_rects=tm.blank_rects,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user