Apply better gaps handling for nested layouts.

This commit is contained in:
Xinhao Yuan 2021-03-28 18:25:37 -04:00
parent 2d197b9faa
commit 971edae6aa
1 changed files with 9 additions and 9 deletions

View File

@ -292,21 +292,21 @@ function module.create(args_or_name, editor, default_cmd)
}, },
-- Not sure how useless_gap adjustment works here. It seems to work anyway. -- Not sure how useless_gap adjustment works here. It seems to work anyway.
workarea = { workarea = {
x = regions[region].x - useless_gap / 2, x = regions[region].x - useless_gap,
y = regions[region].y - useless_gap / 2, y = regions[region].y - useless_gap,
width = regions[region].width + useless_gap, width = regions[region].width + useless_gap * 2,
height = regions[region].height + useless_gap, height = regions[region].height + useless_gap * 2,
}, },
useless_gap = 0, useless_gap = useless_gap,
geometries = {}, geometries = {},
} }
regions[region].layout.arrange(nested_params) regions[region].layout.arrange(nested_params)
for _, c in ipairs(clients) do for _, c in ipairs(clients) do
p.geometries[c] = { p.geometries[c] = {
x = nested_params.geometries[c].x - useless_gap / 2, x = nested_params.geometries[c].x,
y = nested_params.geometries[c].y - useless_gap / 2, y = nested_params.geometries[c].y,
width = nested_params.geometries[c].width + useless_gap, width = nested_params.geometries[c].width,
height = nested_params.geometries[c].height + useless_gap, height = nested_params.geometries[c].height,
} }
end end
end end