mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 22:28:24 +02:00
more work on floats
This commit is contained in:
@@ -366,6 +366,7 @@ class Layout:
|
|||||||
self.update_visibility(all_windows)
|
self.update_visibility(all_windows)
|
||||||
self.blank_rects = []
|
self.blank_rects = []
|
||||||
self.do_layout(all_windows)
|
self.do_layout(all_windows)
|
||||||
|
self.layout_floats(all_windows)
|
||||||
|
|
||||||
def layout_single_window_group(self, wg: WindowGroup, add_blank_rects: bool = True) -> None:
|
def layout_single_window_group(self, wg: WindowGroup, add_blank_rects: bool = True) -> None:
|
||||||
bw = 1 if self.must_draw_borders else 0
|
bw = 1 if self.must_draw_borders else 0
|
||||||
@@ -429,6 +430,11 @@ class Layout:
|
|||||||
def do_layout(self, windows: WindowList) -> None:
|
def do_layout(self, windows: WindowList) -> None:
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def layout_floats(self, windows: WindowList) -> None:
|
||||||
|
for gr in windows.iter_all_floating_groups():
|
||||||
|
# TODO: actually position the float based on its properties
|
||||||
|
self.layout_single_window_group(gr, False)
|
||||||
|
|
||||||
def neighbors_for_window(self, window: WindowType, windows: WindowList) -> NeighborsMap:
|
def neighbors_for_window(self, window: WindowType, windows: WindowList) -> NeighborsMap:
|
||||||
return {'left': [], 'right': [], 'top': [], 'bottom': []}
|
return {'left': [], 'right': [], 'top': [], 'bottom': []}
|
||||||
|
|
||||||
|
|||||||
@@ -239,6 +239,11 @@ class WindowList:
|
|||||||
if g.is_visible_in_layout and not g.is_floating:
|
if g.is_visible_in_layout and not g.is_floating:
|
||||||
yield g
|
yield g
|
||||||
|
|
||||||
|
def iter_all_floating_groups(self) -> Iterator[WindowGroup]:
|
||||||
|
for g in self.groups:
|
||||||
|
if g.is_floating:
|
||||||
|
yield g
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def num_layoutable_groups(self) -> int:
|
def num_layoutable_groups(self) -> int:
|
||||||
ans = 0
|
ans = 0
|
||||||
@@ -468,7 +473,7 @@ class WindowList:
|
|||||||
|
|
||||||
def compute_needs_borders_map(self, draw_active_borders: bool) -> dict[int, bool]:
|
def compute_needs_borders_map(self, draw_active_borders: bool) -> dict[int, bool]:
|
||||||
ag = self.active_group
|
ag = self.active_group
|
||||||
return {gr.id: ((gr is ag and draw_active_borders) or gr.needs_attention) for gr in self.groups}
|
return {gr.id: ((gr is ag and draw_active_borders) or gr.needs_attention) for gr in self.groups if not gr.is_floating}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def num_visble_groups(self) -> int:
|
def num_visble_groups(self) -> int:
|
||||||
|
|||||||
Reference in New Issue
Block a user