Small fix for max layout with no clients

This commit is contained in:
Kevin Alberts 2026-02-08 22:46:32 +01:00
parent d6870c56b0
commit e4b40d40b1

View file

@ -921,11 +921,16 @@ class Kuro(BaseTheme):
ignore_windows = []
if screen_ref and screen_ref.top:
logger.warning(f"Updating margins of bar {screen_ref.top} on screen {screen_ref} for layout {layout_ref}")
# Update margins. Bar should have no margins when there is only one client on screen (Max layout or Columns with 1 window)
# and should have margins in all other cases.
if isinstance(layout_ref, layout.max.Max):
screen_ref.top.margin = [0, 0, 0, 0]
logger.warning(f"Layout clients: {layout_ref.clients}")
logger.warning(f"Ignored clients: {ignore_windows}")
logger.warning(f"Extra clients: {extra_windows}")
if (len(layout_ref.clients) == 0 and len(extra_windows) == 0) or (len(ignore_windows) > 0 and all(w in ignore_windows for w in layout_ref.clients)):
screen_ref.top.margin = [8, 8, 0, 8]
else:
screen_ref.top.margin = [0, 0, 0, 0]
elif isinstance(layout_ref, layout.columns.Columns):
clients = extra_windows
for column in layout_ref.columns: