Fix overlay windows not inheriting the per-window padding and margin settings of their parents

Fixes #6063
This commit is contained in:
Kovid Goyal 2023-03-01 21:45:17 +05:30
parent 66804dafe8
commit fccd776732
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 12 additions and 3 deletions

View File

@ -69,6 +69,9 @@ Detailed list of changes
- hints kitten: Allow copying matches to named buffers (:disc:`6073`) - hints kitten: Allow copying matches to named buffers (:disc:`6073`)
- Fix overlay windows not inheriting the per-window padding and margin settings
of their parents (:iss:`6063`)
0.27.1 [2023-02-07] 0.27.1 [2023-02-07]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -282,7 +282,10 @@ class Layout:
self, all_windows: WindowList, window: WindowType, location: Optional[str] = None, self, all_windows: WindowList, window: WindowType, location: Optional[str] = None,
overlay_for: Optional[int] = None, put_overlay_behind: bool = False overlay_for: Optional[int] = None, put_overlay_behind: bool = False
) -> None: ) -> None:
if overlay_for is not None and overlay_for in all_windows: if overlay_for is not None:
underlay = all_windows.id_map.get(overlay_for)
if underlay is not None:
window.margin, window.padding = underlay.margin.copy(), underlay.padding.copy()
all_windows.add_window(window, group_of=overlay_for, head_of_group=put_overlay_behind) all_windows.add_window(window, group_of=overlay_for, head_of_group=put_overlay_behind)
return return
if location == 'neighbor': if location == 'neighbor':

View File

@ -508,6 +508,9 @@ class EdgeWidths:
def serialize(self) -> Dict[str, Optional[float]]: def serialize(self) -> Dict[str, Optional[float]]:
return {'left': self.left, 'right': self.right, 'top': self.top, 'bottom': self.bottom} return {'left': self.left, 'right': self.right, 'top': self.top, 'bottom': self.bottom}
def copy(self) -> 'EdgeWidths':
return EdgeWidths(self.serialize())
class GlobalWatchers: class GlobalWatchers: