awful.tag: setters have low and high bounding values

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-01-26 10:37:52 +01:00
parent 139dea2987
commit d8f20e34fe
1 changed files with 12 additions and 6 deletions

View File

@ -103,8 +103,10 @@ end
-- @param mwfact Master width factor. -- @param mwfact Master width factor.
function setmwfact(mwfact, t) function setmwfact(mwfact, t)
local t = t or selected() local t = t or selected()
setproperty(t, "mwfact", mwfact) if mwfact >= 0 and mwfact <= 1 then
capi.hooks.arrange()(t.screen) setproperty(t, "mwfact", mwfact)
capi.hooks.arrange()(t.screen)
end
end end
--- Increase master width factor. --- Increase master width factor.
@ -125,8 +127,10 @@ end
-- @param t Optional tag. -- @param t Optional tag.
function setnmaster(nmaster, t) function setnmaster(nmaster, t)
local t = t or selected() local t = t or selected()
setproperty(t, "nmaster", nmaster) if nmaster >= 0 then
capi.hooks.arrange()(t.screen) setproperty(t, "nmaster", nmaster)
capi.hooks.arrange()(t.screen)
end
end end
--- Get the number of master windows. --- Get the number of master windows.
@ -163,8 +167,10 @@ end
-- @param ncol The number of column. -- @param ncol The number of column.
function setncol(ncol, t) function setncol(ncol, t)
local t = t or selected() local t = t or selected()
setproperty(t, "ncol", ncol) if ncol >= 1 then
capi.hooks.arrange()(t.screen) setproperty(t, "ncol", ncol)
capi.hooks.arrange()(t.screen)
end
end end
--- Get number of column windows. --- Get number of column windows.