Start cleanup of previous PR
This commit is contained in:
@@ -3325,8 +3325,7 @@ class Boss:
|
|||||||
tab.relayout()
|
tab.relayout()
|
||||||
|
|
||||||
def _insert_window_in_direction(
|
def _insert_window_in_direction(
|
||||||
self, window: Window, dest_window: Window,
|
self, window: Window, dest_window: Window, direction: Literal['left', 'right', 'top', 'bottom'],
|
||||||
direction: str
|
|
||||||
) -> None:
|
) -> None:
|
||||||
src_tab = window.tabref()
|
src_tab = window.tabref()
|
||||||
dest_tab = dest_window.tabref()
|
dest_tab = dest_window.tabref()
|
||||||
|
|||||||
@@ -1113,6 +1113,14 @@ class Tab: # {{{
|
|||||||
tm = self.tab_manager_ref()
|
tm = self.tab_manager_ref()
|
||||||
if tm is not None:
|
if tm is not None:
|
||||||
tm.set_active_tab(self)
|
tm.set_active_tab(self)
|
||||||
|
|
||||||
|
def swap_windows(self, window_a: Window, window_b: Window) -> None:
|
||||||
|
if (wg_b := self.windows.group_for_window(window_b)) is None:
|
||||||
|
return
|
||||||
|
with get_boss().suppress_focus_change_events():
|
||||||
|
self.windows.set_active_window_group_for(window_a)
|
||||||
|
self.current_layout.move_window_to_group(self.windows, wg_b.id)
|
||||||
|
self.relayout()
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
@@ -2024,9 +2032,9 @@ class TabManager: # {{{
|
|||||||
return
|
return
|
||||||
|
|
||||||
if dest_in_title_bar:
|
if dest_in_title_bar:
|
||||||
if w.tabref() is dest_window.tabref():
|
if (src_tab := w.tabref()) is dest_window.tabref() and src_tab is not None:
|
||||||
# Same tab: swap positions
|
# Same tab: swap positions
|
||||||
boss._swap_windows(w, dest_window)
|
src_tab.swap_windows(w, dest_window)
|
||||||
else:
|
else:
|
||||||
# Cross-tab title bar drop: move to the destination tab
|
# Cross-tab title bar drop: move to the destination tab
|
||||||
boss._move_window_to(w, target_tab_id=active_tab.id)
|
boss._move_window_to(w, target_tab_id=active_tab.id)
|
||||||
|
|||||||
Reference in New Issue
Block a user