feat(lib: awful: layout: suit: tile): add support for 'master_fill_policy'
This commit is contained in:
parent
0028349226
commit
fb4a331014
|
@ -216,13 +216,17 @@ local function do_tile(param, orientation)
|
||||||
place_master = false
|
place_master = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local grow_master = tag.getmfpol(t) == "expand"
|
||||||
-- this was easier than writing functions because there is a lot of data we need
|
-- this was easier than writing functions because there is a lot of data we need
|
||||||
for d = 1,2 do
|
for d = 1,2 do
|
||||||
if place_master and nmaster > 0 then
|
if place_master and nmaster > 0 then
|
||||||
local size = wa[width]
|
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]))
|
size = math.min(wa[width] * mwfact, wa[width] - (coord - wa[x]))
|
||||||
end
|
end
|
||||||
|
if nother == 0 and not grow_master then
|
||||||
|
coord = coord + (wa[width] - size)/2
|
||||||
|
end
|
||||||
if not data[0] then
|
if not data[0] then
|
||||||
data[0] = {}
|
data[0] = {}
|
||||||
end
|
end
|
||||||
|
|
|
@ -409,7 +409,7 @@ function tag.getgap(t)
|
||||||
return tag.getproperty(t, "useless_gap") or beautiful.useless_gap or 0
|
return tag.getproperty(t, "useless_gap") or beautiful.useless_gap or 0
|
||||||
end
|
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
|
-- @tparam string policy Can be set to
|
||||||
-- "expand" (fill all the available workarea) or
|
-- "expand" (fill all the available workarea) or
|
||||||
-- "mwfact" (fill only an area inside the master width factor)
|
-- "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)
|
tag.setproperty(t, "master_fill_policy", enabled)
|
||||||
end
|
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.
|
-- @tparam tag t The tag to modify, if null tag.selected() is used.
|
||||||
function tag.togglemfpol(t)
|
function tag.togglemfpol(t)
|
||||||
if tag.getmfpol(t) == "expand" then
|
if tag.getmfpol(t) == "expand" then
|
||||||
|
@ -429,7 +429,7 @@ function tag.togglemfpol(t)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get sizing policy for the master client(s)
|
--- Get size fill policy for the master client(s)
|
||||||
-- @tparam tag t Optional tag.
|
-- @tparam tag t Optional tag.
|
||||||
-- @treturn string Can be set to
|
-- @treturn string Can be set to
|
||||||
-- "expand" (fill all the available workarea) or
|
-- "expand" (fill all the available workarea) or
|
||||||
|
|
Loading…
Reference in New Issue