feat(lib: awful: layout: suit: tile): add support for 'master_fill_policy'

This commit is contained in:
actionless 2015-07-16 11:48:18 +02:00
parent 0028349226
commit fb4a331014
2 changed files with 8 additions and 4 deletions

View File

@ -216,13 +216,17 @@ local function do_tile(param, orientation)
place_master = false
end
local grow_master = tag.getmfpol(t) == "expand"
-- this was easier than writing functions because there is a lot of data we need
for d = 1,2 do
if place_master and nmaster > 0 then
local size = wa[width]
if nother > 0 then
if nother > 0 or not grow_master then
size = math.min(wa[width] * mwfact, wa[width] - (coord - wa[x]))
end
if nother == 0 and not grow_master then
coord = coord + (wa[width] - size)/2
end
if not data[0] then
data[0] = {}
end

View File

@ -409,7 +409,7 @@ function tag.getgap(t)
return tag.getproperty(t, "useless_gap") or beautiful.useless_gap or 0
end
--- Set sizing policy for the master client(s)
--- Set size fill policy for the master client(s)
-- @tparam string policy Can be set to
-- "expand" (fill all the available workarea) or
-- "mwfact" (fill only an area inside the master width factor)
@ -419,7 +419,7 @@ function tag.setmfpol(enabled, t)
tag.setproperty(t, "master_fill_policy", enabled)
end
--- Toggle sizing policy for the master client(s)
--- Toggle size fill policy for the master client(s)
-- @tparam tag t The tag to modify, if null tag.selected() is used.
function tag.togglemfpol(t)
if tag.getmfpol(t) == "expand" then
@ -429,7 +429,7 @@ function tag.togglemfpol(t)
end
end
--- Get sizing policy for the master client(s)
--- Get size fill policy for the master client(s)
-- @tparam tag t Optional tag.
-- @treturn string Can be set to
-- "expand" (fill all the available workarea) or