mirror of https://github.com/lcpz/lain.git
Merge branch 'master' of https://github.com/copycat-killer/lain
This commit is contained in:
commit
bd3d30c4ad
|
@ -28,15 +28,12 @@ function cascade.arrange(p)
|
||||||
local global_border = tonumber(beautiful.global_border_width) or 0
|
local global_border = tonumber(beautiful.global_border_width) or 0
|
||||||
if global_border < 0 then global_border = 0 end
|
if global_border < 0 then global_border = 0 end
|
||||||
|
|
||||||
-- Themes border width requires an offset.
|
|
||||||
local bw = tonumber(beautiful.border_width) or 0
|
|
||||||
|
|
||||||
-- Screen.
|
-- Screen.
|
||||||
local wa = p.workarea
|
local wa = p.workarea
|
||||||
local cls = p.clients
|
local cls = p.clients
|
||||||
|
|
||||||
wa.height = wa.height - ((global_border * 2) + (bw * 2))
|
wa.height = wa.height - (global_border * 2)
|
||||||
wa.width = wa.width - ((global_border * 2) + (bw * 2))
|
wa.width = wa.width - (global_border * 2)
|
||||||
wa.x = wa.x + global_border
|
wa.x = wa.x + global_border
|
||||||
wa.y = wa.y + global_border
|
wa.y = wa.y + global_border
|
||||||
|
|
||||||
|
@ -70,8 +67,10 @@ function cascade.arrange(p)
|
||||||
|
|
||||||
g.x = wa.x + (how_many - i) * cascade.offset_x
|
g.x = wa.x + (how_many - i) * cascade.offset_x
|
||||||
g.y = wa.y + (i - 1) * cascade.offset_y
|
g.y = wa.y + (i - 1) * cascade.offset_y
|
||||||
g.width = wa.width - current_offset_x
|
g.width = wa.width - current_offset_x - 2*c.border_width
|
||||||
g.height = wa.height - current_offset_y
|
g.height = wa.height - current_offset_y - 2*c.border_width
|
||||||
|
if g.width < 1 then g.width = 1 end
|
||||||
|
if g.height < 1 then g.height = 1 end
|
||||||
|
|
||||||
c:geometry(g)
|
c:geometry(g)
|
||||||
end
|
end
|
||||||
|
|
|
@ -50,16 +50,15 @@ function cascadetile.arrange(p)
|
||||||
local global_border = tonumber(beautiful.global_border_width) or 0
|
local global_border = tonumber(beautiful.global_border_width) or 0
|
||||||
if global_border < 0 then global_border = 0 end
|
if global_border < 0 then global_border = 0 end
|
||||||
|
|
||||||
-- Themes border width requires an offset
|
|
||||||
local bw = tonumber(beautiful.border_width) or 0
|
|
||||||
|
|
||||||
-- Screen.
|
-- Screen.
|
||||||
local wa = p.workarea
|
local wa = p.workarea
|
||||||
local cls = p.clients
|
local cls = p.clients
|
||||||
|
|
||||||
-- Borders are factored in.
|
-- Borders are factored in.
|
||||||
wa.height = wa.height - ((global_border * 2) + (bw * 2))
|
wa.height = wa.height - (global_border * 2)
|
||||||
wa.width = wa.width - ((global_border * 2) + (bw * 2))
|
wa.width = wa.width - (global_border * 2)
|
||||||
|
wa.x = wa.x + global_border
|
||||||
|
wa.y = wa.y + global_border
|
||||||
|
|
||||||
-- Width of main column?
|
-- Width of main column?
|
||||||
local t = tag.selected(p.screen)
|
local t = tag.selected(p.screen)
|
||||||
|
@ -100,14 +99,18 @@ function cascadetile.arrange(p)
|
||||||
if #cls > 0
|
if #cls > 0
|
||||||
then
|
then
|
||||||
-- Main column, fixed width and height.
|
-- Main column, fixed width and height.
|
||||||
local c = cls[#cls]
|
local c = cls[1]
|
||||||
local g = {}
|
local g = {}
|
||||||
local mainwid = wa.width * mwfact
|
-- Subtracting the useless_gap width from the work area width here
|
||||||
|
-- makes this mwfact calculation work the same as in uselesstile.
|
||||||
|
-- Rounding is necessary to prevent the rendered size of slavewid
|
||||||
|
-- from being 1 pixel off when the result is not an integer.
|
||||||
|
local mainwid = math.floor((wa.width - useless_gap) * mwfact)
|
||||||
local slavewid = wa.width - mainwid
|
local slavewid = wa.width - mainwid
|
||||||
|
|
||||||
if overlap_main == 1
|
if overlap_main == 1
|
||||||
then
|
then
|
||||||
g.width = wa.width
|
g.width = wa.width - 2*c.border_width
|
||||||
|
|
||||||
-- The size of the main window may be reduced a little bit.
|
-- The size of the main window may be reduced a little bit.
|
||||||
-- This allows you to see if there are any windows below the
|
-- This allows you to see if there are any windows below the
|
||||||
|
@ -116,12 +119,12 @@ function cascadetile.arrange(p)
|
||||||
-- overlapping everything else.
|
-- overlapping everything else.
|
||||||
g.width = g.width - cascadetile.extra_padding
|
g.width = g.width - cascadetile.extra_padding
|
||||||
else
|
else
|
||||||
g.width = mainwid
|
g.width = mainwid - 2*c.border_width
|
||||||
end
|
end
|
||||||
|
|
||||||
g.height = wa.height
|
g.height = wa.height - 2*c.border_width
|
||||||
g.x = wa.x + global_border
|
g.x = wa.x
|
||||||
g.y = wa.y + global_border
|
g.y = wa.y
|
||||||
if useless_gap > 0
|
if useless_gap > 0
|
||||||
then
|
then
|
||||||
-- Reduce width once and move window to the right. Reduce
|
-- Reduce width once and move window to the right. Reduce
|
||||||
|
@ -138,19 +141,21 @@ function cascadetile.arrange(p)
|
||||||
g.width = g.width - useless_gap
|
g.width = g.width - useless_gap
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if g.width < 1 then g.width = 1 end
|
||||||
|
if g.height < 1 then g.height = 1 end
|
||||||
c:geometry(g)
|
c:geometry(g)
|
||||||
|
|
||||||
-- Remaining clients stacked in slave column, new ones on top.
|
-- Remaining clients stacked in slave column, new ones on top.
|
||||||
if #cls > 1
|
if #cls > 1
|
||||||
then
|
then
|
||||||
for i = (#cls - 1),1,-1
|
for i = 2,#cls
|
||||||
do
|
do
|
||||||
c = cls[i]
|
c = cls[i]
|
||||||
g = {}
|
g = {}
|
||||||
g.width = slavewid - current_offset_x
|
g.width = slavewid - current_offset_x - 2*c.border_width
|
||||||
g.height = wa.height - current_offset_y
|
g.height = wa.height - current_offset_y - 2*c.border_width
|
||||||
g.x = wa.x + mainwid + (how_many - i) * cascadetile.offset_x
|
g.x = wa.x + mainwid + (how_many - (i - 1)) * cascadetile.offset_x
|
||||||
g.y = wa.y + (i - 1) * cascadetile.offset_y + global_border
|
g.y = wa.y + (i - 2) * cascadetile.offset_y
|
||||||
if useless_gap > 0
|
if useless_gap > 0
|
||||||
then
|
then
|
||||||
g.width = g.width - 2 * useless_gap
|
g.width = g.width - 2 * useless_gap
|
||||||
|
@ -158,6 +163,8 @@ function cascadetile.arrange(p)
|
||||||
g.x = g.x + useless_gap
|
g.x = g.x + useless_gap
|
||||||
g.y = g.y + useless_gap
|
g.y = g.y + useless_gap
|
||||||
end
|
end
|
||||||
|
if g.width < 1 then g.width = 1 end
|
||||||
|
if g.height < 1 then g.height = 1 end
|
||||||
c:geometry(g)
|
c:geometry(g)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -49,16 +49,15 @@ function centerfair.arrange(p)
|
||||||
local global_border = tonumber(beautiful.global_border_width) or 0
|
local global_border = tonumber(beautiful.global_border_width) or 0
|
||||||
if global_border < 0 then global_border = 0 end
|
if global_border < 0 then global_border = 0 end
|
||||||
|
|
||||||
-- Themes border width requires an offset
|
|
||||||
local bw = tonumber(beautiful.border_width) or 0
|
|
||||||
|
|
||||||
-- Screen.
|
-- Screen.
|
||||||
local wa = p.workarea
|
local wa = p.workarea
|
||||||
local cls = p.clients
|
local cls = p.clients
|
||||||
|
|
||||||
-- Borders are factored in.
|
-- Borders are factored in.
|
||||||
wa.height = wa.height - ((global_border * 2) + (bw * 2))
|
wa.height = wa.height - (global_border * 2)
|
||||||
wa.width = wa.width - ((global_border * 2) + (bw * 2))
|
wa.width = wa.width - (global_border * 2)
|
||||||
|
wa.x = wa.x + global_border
|
||||||
|
wa.y = wa.y + global_border
|
||||||
|
|
||||||
-- How many vertical columns? Read from nmaster on the tag.
|
-- How many vertical columns? Read from nmaster on the tag.
|
||||||
local t = tag.selected(p.screen)
|
local t = tag.selected(p.screen)
|
||||||
|
@ -68,34 +67,34 @@ function centerfair.arrange(p)
|
||||||
|
|
||||||
local width = math.floor((wa.width - (num_x + 1)*useless_gap) / num_x)
|
local width = math.floor((wa.width - (num_x + 1)*useless_gap) / num_x)
|
||||||
|
|
||||||
local offset_y = wa.y + useless_gap
|
|
||||||
if #cls < num_x
|
if #cls < num_x
|
||||||
then
|
then
|
||||||
-- Less clients than the number of columns, let's center it!
|
-- Less clients than the number of columns, let's center it!
|
||||||
local offset_x = wa.x + useless_gap + (wa.width - #cls*width - (#cls+1)*useless_gap) / 2
|
local offset_x = wa.x + (wa.width - #cls*width - (#cls - 1)*useless_gap) / 2
|
||||||
local g = {}
|
local g = {}
|
||||||
g.width = width
|
g.y = wa.y + useless_gap
|
||||||
g.height = wa.height - 2*useless_gap - 2
|
|
||||||
g.y = offset_y + global_border
|
|
||||||
for i = 1, #cls do
|
for i = 1, #cls do
|
||||||
g.x = offset_x + (#cls - i) * (width + useless_gap + 2) + global_border
|
local c = cls[i]
|
||||||
cls[i]:geometry(g)
|
g.width = width - 2*c.border_width
|
||||||
|
g.height = wa.height - 2*useless_gap - 2*c.border_width
|
||||||
|
if g.width < 1 then g.width = 1 end
|
||||||
|
if g.height < 1 then g.height = 1 end
|
||||||
|
g.x = offset_x + (i - 1) * (width + useless_gap)
|
||||||
|
c:geometry(g)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- More clients than the number of columns, let's arrange it!
|
-- More clients than the number of columns, let's arrange it!
|
||||||
local offset_x = wa.x
|
|
||||||
if useless_gap > 0 then
|
|
||||||
offset_x = offset_x
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Master client deserves a special treatement
|
-- Master client deserves a special treatement
|
||||||
|
local c = cls[1]
|
||||||
local g = {}
|
local g = {}
|
||||||
g.width = wa.width - (num_x - 1) * width - num_x * 2*useless_gap - 2
|
g.width = wa.width - (num_x - 1)*width - (num_x + 1)*useless_gap - 2*c.border_width
|
||||||
g.height = wa.height - 2*useless_gap - 2
|
g.height = wa.height - 2*useless_gap - 2*c.border_width
|
||||||
g.x = offset_x + useless_gap + global_border
|
if g.width < 1 then g.width = 1 end
|
||||||
g.y = offset_y + global_border
|
if g.height < 1 then g.height = 1 end
|
||||||
|
g.x = wa.x + useless_gap
|
||||||
|
g.y = wa.y + useless_gap
|
||||||
|
|
||||||
cls[#cls]:geometry(g)
|
c:geometry(g)
|
||||||
|
|
||||||
-- Treat the other clients
|
-- Treat the other clients
|
||||||
|
|
||||||
|
@ -134,28 +133,30 @@ function centerfair.arrange(p)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Compute geometry of the other clients
|
-- Compute geometry of the other clients
|
||||||
local nclient = #cls-1 -- we start with the 2nd client
|
local nclient = 2 -- we start with the 2nd client
|
||||||
g.x = g.x + g.width+useless_gap + 2
|
g.x = g.x + g.width + useless_gap + 2*c.border_width
|
||||||
g.width = width
|
|
||||||
|
|
||||||
if useless_gap > 0 then
|
|
||||||
g.width = g.width + useless_gap - 2
|
|
||||||
end
|
|
||||||
|
|
||||||
for i = 1, (num_x-1) do
|
for i = 1, (num_x-1) do
|
||||||
to_remove = 2
|
local height = math.floor((wa.height - (num_y[i] + 1)*useless_gap) / num_y[i])
|
||||||
g.height = math.floor((wa.height - (num_y[i] * useless_gap)) / num_y[i])
|
g.y = wa.y + useless_gap
|
||||||
g.y = offset_y + global_border
|
|
||||||
for j = 0, (num_y[i]-2) do
|
for j = 0, (num_y[i]-2) do
|
||||||
cls[nclient]:geometry(g)
|
local c = cls[nclient]
|
||||||
nclient = nclient - 1
|
g.height = height - 2*c.border_width
|
||||||
g.y = g.y + g.height+useless_gap + 2
|
g.width = width - 2*c.border_width
|
||||||
to_remove = to_remove + 2
|
if g.width < 1 then g.width = 1 end
|
||||||
|
if g.height < 1 then g.height = 1 end
|
||||||
|
c:geometry(g)
|
||||||
|
nclient = nclient + 1
|
||||||
|
g.y = g.y + height + useless_gap
|
||||||
end
|
end
|
||||||
g.height = wa.height - num_y[i]*useless_gap - (num_y[i]-1)*g.height - useless_gap - to_remove
|
local c = cls[nclient]
|
||||||
cls[nclient]:geometry(g)
|
g.height = wa.height - (num_y[i] + 1)*useless_gap - (num_y[i] - 1)*height - 2*c.border_width
|
||||||
nclient = nclient - 1
|
g.width = width - 2*c.border_width
|
||||||
g.x = g.x+g.width+useless_gap + 2
|
if g.width < 1 then g.width = 1 end
|
||||||
|
if g.height < 1 then g.height = 1 end
|
||||||
|
c:geometry(g)
|
||||||
|
nclient = nclient + 1
|
||||||
|
g.x = g.x + width + useless_gap
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,10 +16,10 @@ local math = { floor = math.floor }
|
||||||
local centerwork =
|
local centerwork =
|
||||||
{
|
{
|
||||||
name = "centerwork",
|
name = "centerwork",
|
||||||
top_left = 0,
|
top_right = 0,
|
||||||
top_right = 1,
|
bottom_right = 1,
|
||||||
bottom_left = 2,
|
bottom_left = 2,
|
||||||
bottom_right = 3
|
top_left = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
function centerwork.arrange(p)
|
function centerwork.arrange(p)
|
||||||
|
@ -32,16 +32,15 @@ function centerwork.arrange(p)
|
||||||
local global_border = tonumber(beautiful.global_border_width) or 0
|
local global_border = tonumber(beautiful.global_border_width) or 0
|
||||||
if global_border < 0 then global_border = 0 end
|
if global_border < 0 then global_border = 0 end
|
||||||
|
|
||||||
-- Themes border width requires an offset
|
|
||||||
local bw = tonumber(beautiful.border_width) or 0
|
|
||||||
|
|
||||||
-- Screen.
|
-- Screen.
|
||||||
local wa = p.workarea
|
local wa = p.workarea
|
||||||
local cls = p.clients
|
local cls = p.clients
|
||||||
|
|
||||||
-- Borders are factored in.
|
-- Borders are factored in.
|
||||||
wa.height = wa.height - ((global_border * 2) + (bw * 2))
|
wa.height = wa.height - (global_border * 2)
|
||||||
wa.width = wa.width - ((global_border * 2) + (bw * 2))
|
wa.width = wa.width - (global_border * 2)
|
||||||
|
wa.x = wa.x + global_border
|
||||||
|
wa.y = wa.y + global_border
|
||||||
|
|
||||||
-- Width of main column?
|
-- Width of main column?
|
||||||
local t = awful.tag.selected(p.screen)
|
local t = awful.tag.selected(p.screen)
|
||||||
|
@ -50,7 +49,7 @@ function centerwork.arrange(p)
|
||||||
if #cls > 0
|
if #cls > 0
|
||||||
then
|
then
|
||||||
-- Main column, fixed width and height.
|
-- Main column, fixed width and height.
|
||||||
local c = cls[#cls]
|
local c = cls[1]
|
||||||
local g = {}
|
local g = {}
|
||||||
local mainwid = math.floor(wa.width * mwfact)
|
local mainwid = math.floor(wa.width * mwfact)
|
||||||
local slavewid = wa.width - mainwid
|
local slavewid = wa.width - mainwid
|
||||||
|
@ -59,10 +58,12 @@ function centerwork.arrange(p)
|
||||||
local slaveThei = math.floor(wa.height / 2)
|
local slaveThei = math.floor(wa.height / 2)
|
||||||
local slaveBhei = wa.height - slaveThei
|
local slaveBhei = wa.height - slaveThei
|
||||||
|
|
||||||
g.height = wa.height - 2 * useless_gap
|
g.height = wa.height - 2*useless_gap - 2*c.border_width
|
||||||
g.width = mainwid
|
g.width = mainwid - 2*c.border_width
|
||||||
g.x = wa.x + slaveLwid + global_border
|
if g.width < 1 then g.width = 1 end
|
||||||
g.y = wa.y + useless_gap + global_border
|
if g.height < 1 then g.height = 1 end
|
||||||
|
g.x = wa.x + slaveLwid
|
||||||
|
g.y = wa.y + useless_gap
|
||||||
|
|
||||||
c:geometry(g)
|
c:geometry(g)
|
||||||
|
|
||||||
|
@ -70,7 +71,7 @@ function centerwork.arrange(p)
|
||||||
if #cls > 1
|
if #cls > 1
|
||||||
then
|
then
|
||||||
local at = 0
|
local at = 0
|
||||||
for i = (#cls - 1),1,-1
|
for i = 2,#cls
|
||||||
do
|
do
|
||||||
-- It's all fixed. If there are more than 5 clients,
|
-- It's all fixed. If there are more than 5 clients,
|
||||||
-- those additional clients will float. This is
|
-- those additional clients will float. This is
|
||||||
|
@ -83,36 +84,38 @@ function centerwork.arrange(p)
|
||||||
c = cls[i]
|
c = cls[i]
|
||||||
g = {}
|
g = {}
|
||||||
|
|
||||||
if at == centerwork.top_left
|
if i - 2 == centerwork.top_left
|
||||||
then
|
then
|
||||||
-- top left
|
-- top left
|
||||||
g.x = wa.x + useless_gap + global_border
|
g.x = wa.x + useless_gap
|
||||||
g.y = wa.y + useless_gap + global_border
|
g.y = wa.y + useless_gap
|
||||||
g.width = slaveLwid - 2 * useless_gap
|
g.width = slaveLwid - 2*useless_gap - 2*c.border_width
|
||||||
g.height = slaveThei - useless_gap
|
g.height = slaveThei - useless_gap - 2*c.border_width
|
||||||
elseif at == centerwork.top_right
|
elseif i - 2 == centerwork.top_right
|
||||||
then
|
then
|
||||||
-- top right
|
-- top right
|
||||||
g.x = wa.x + slaveLwid + mainwid + useless_gap + global_border
|
g.x = wa.x + slaveLwid + mainwid + useless_gap
|
||||||
g.y = wa.y + useless_gap + global_border
|
g.y = wa.y + useless_gap
|
||||||
g.width = slaveRwid - 2 * useless_gap
|
g.width = slaveRwid - 2*useless_gap - 2*c.border_width
|
||||||
g.height = slaveThei - useless_gap
|
g.height = slaveThei - useless_gap - 2*c.border_width
|
||||||
elseif at == centerwork.bottom_left
|
elseif i - 2 == centerwork.bottom_left
|
||||||
then
|
then
|
||||||
-- bottom left
|
-- bottom left
|
||||||
g.x = wa.x + useless_gap + global_border
|
g.x = wa.x + useless_gap
|
||||||
g.y = wa.y + slaveThei + useless_gap + global_border
|
g.y = wa.y + slaveThei + useless_gap
|
||||||
g.width = slaveLwid - 2 * useless_gap
|
g.width = slaveLwid - 2*useless_gap - 2*c.border_width
|
||||||
g.height = slaveBhei - 2 * useless_gap
|
g.height = slaveBhei - 2*useless_gap - 2*c.border_width
|
||||||
elseif at == centerwork.bottom_right
|
elseif i - 2 == centerwork.bottom_right
|
||||||
then
|
then
|
||||||
-- bottom right
|
-- bottom right
|
||||||
g.x = wa.x + slaveLwid + mainwid + useless_gap + global_border
|
g.x = wa.x + slaveLwid + mainwid + useless_gap
|
||||||
g.y = wa.y + slaveThei + useless_gap + global_border
|
g.y = wa.y + slaveThei + useless_gap
|
||||||
g.width = slaveRwid - 2 * useless_gap
|
g.width = slaveRwid - 2*useless_gap - 2*c.border_width
|
||||||
g.height = slaveBhei - 2 * useless_gap
|
g.height = slaveBhei - 2*useless_gap - 2*c.border_width
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if g.width < 1 then g.width = 1 end
|
||||||
|
if g.height < 1 then g.height = 1 end
|
||||||
c:geometry(g)
|
c:geometry(g)
|
||||||
|
|
||||||
at = at + 1
|
at = at + 1
|
||||||
|
|
|
@ -46,16 +46,15 @@ function termfair.arrange(p)
|
||||||
local global_border = tonumber(beautiful.global_border_width) or 0
|
local global_border = tonumber(beautiful.global_border_width) or 0
|
||||||
if global_border < 0 then global_border = 0 end
|
if global_border < 0 then global_border = 0 end
|
||||||
|
|
||||||
-- Themes border width requires an offset
|
|
||||||
local bw = tonumber(beautiful.border_width) or 0
|
|
||||||
|
|
||||||
-- Screen.
|
-- Screen.
|
||||||
local wa = p.workarea
|
local wa = p.workarea
|
||||||
local cls = p.clients
|
local cls = p.clients
|
||||||
|
|
||||||
-- Borders are factored in.
|
-- Borders are factored in.
|
||||||
wa.height = wa.height - ((global_border * 2) + (bw * 2))
|
wa.height = wa.height - (global_border * 2)
|
||||||
wa.width = wa.width - ((global_border * 2) + (bw * 2))
|
wa.width = wa.width - (global_border * 2)
|
||||||
|
wa.x = wa.x + global_border
|
||||||
|
wa.y = wa.y + global_border
|
||||||
|
|
||||||
-- How many vertical columns?
|
-- How many vertical columns?
|
||||||
local t = tag.selected(p.screen)
|
local t = tag.selected(p.screen)
|
||||||
|
@ -71,8 +70,8 @@ function termfair.arrange(p)
|
||||||
local at_x = 0
|
local at_x = 0
|
||||||
local at_y = 0
|
local at_y = 0
|
||||||
local remaining_clients = #cls
|
local remaining_clients = #cls
|
||||||
local width = math.floor(wa.width / num_x)
|
local width = math.floor((wa.width - (num_x + 1)*useless_gap) / num_x)
|
||||||
local height = math.floor(wa.height / num_y)
|
local height = math.floor((wa.height - (num_y + 1)*useless_gap) / num_y)
|
||||||
|
|
||||||
-- We start the first row. Left-align by limiting the number of
|
-- We start the first row. Left-align by limiting the number of
|
||||||
-- available slots.
|
-- available slots.
|
||||||
|
@ -93,27 +92,29 @@ function termfair.arrange(p)
|
||||||
local g = {}
|
local g = {}
|
||||||
if this_x == (num_x - 1)
|
if this_x == (num_x - 1)
|
||||||
then
|
then
|
||||||
g.width = wa.width - (num_x - 1) * width - useless_gap
|
g.width = wa.width - (num_x - 1)*width - (num_x + 1)*useless_gap - 2*c.border_width
|
||||||
else
|
else
|
||||||
g.width = width - useless_gap
|
g.width = width - 2*c.border_width
|
||||||
end
|
end
|
||||||
if this_y == (num_y - 1)
|
if this_y == (num_y - 1)
|
||||||
then
|
then
|
||||||
g.height = wa.height - (num_y - 1) * height - useless_gap
|
g.height = wa.height - (num_y - 1)*height - (num_y + 1)*useless_gap - 2*c.border_width
|
||||||
else
|
else
|
||||||
g.height = height - useless_gap
|
g.height = height - 2*c.border_width
|
||||||
end
|
end
|
||||||
|
|
||||||
g.x = wa.x + this_x * width + global_border
|
g.x = wa.x + this_x*width
|
||||||
g.y = wa.y + this_y * height + global_border
|
g.y = wa.y + this_y*height
|
||||||
|
|
||||||
if useless_gap > 0
|
if useless_gap > 0
|
||||||
then
|
then
|
||||||
-- All clients tile evenly.
|
-- All clients tile evenly.
|
||||||
g.x = g.x + (useless_gap / 2)
|
g.x = g.x + (this_x + 1)*useless_gap
|
||||||
g.y = g.y + (useless_gap / 2)
|
g.y = g.y + (this_y + 1)*useless_gap
|
||||||
|
|
||||||
end
|
end
|
||||||
|
if g.width < 1 then g.width = 1 end
|
||||||
|
if g.height < 1 then g.height = 1 end
|
||||||
c:geometry(g)
|
c:geometry(g)
|
||||||
remaining_clients = remaining_clients - 1
|
remaining_clients = remaining_clients - 1
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ end
|
||||||
|
|
||||||
-- Find geometry for secondary windows column
|
-- Find geometry for secondary windows column
|
||||||
local function cut_column(wa, n, index)
|
local function cut_column(wa, n, index)
|
||||||
local width = wa.width / n
|
local width = math.floor(wa.width / n)
|
||||||
local area = { x = wa.x + (index - 1) * width, y = wa.y, width = width, height = wa.height }
|
local area = { x = wa.x + (index - 1) * width, y = wa.y, width = width, height = wa.height }
|
||||||
|
|
||||||
return area
|
return area
|
||||||
|
@ -45,7 +45,7 @@ end
|
||||||
|
|
||||||
-- Find geometry for certain window in column
|
-- Find geometry for certain window in column
|
||||||
local function cut_row(wa, factor, index, used)
|
local function cut_row(wa, factor, index, used)
|
||||||
local height = wa.height * factor.window[index] / factor.total
|
local height = math.floor(wa.height * factor.window[index] / factor.total)
|
||||||
local area = { x = wa.x, y = wa.y + used, width = wa.width, height = height }
|
local area = { x = wa.x, y = wa.y + used, width = wa.width, height = height }
|
||||||
|
|
||||||
return area
|
return area
|
||||||
|
@ -55,8 +55,8 @@ end
|
||||||
local function size_correction(c, geometry, useless_gap)
|
local function size_correction(c, geometry, useless_gap)
|
||||||
geometry.width = math.max(geometry.width - 2 * c.border_width - useless_gap, 1)
|
geometry.width = math.max(geometry.width - 2 * c.border_width - useless_gap, 1)
|
||||||
geometry.height = math.max(geometry.height - 2 * c.border_width - useless_gap, 1)
|
geometry.height = math.max(geometry.height - 2 * c.border_width - useless_gap, 1)
|
||||||
geometry.x = geometry.x + useless_gap / 2
|
geometry.x = math.floor(geometry.x + useless_gap / 2)
|
||||||
geometry.y = geometry.y + useless_gap / 2
|
geometry.y = math.floor(geometry.y + useless_gap / 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Check size factor for group of clients and calculate total
|
-- Check size factor for group of clients and calculate total
|
||||||
|
@ -85,6 +85,7 @@ local function tile_column(canvas, area, list, useless_gap, transformation, winf
|
||||||
|
|
||||||
for i, c in ipairs(list) do
|
for i, c in ipairs(list) do
|
||||||
local g = cut_row(area, factor, i, used)
|
local g = cut_row(area, factor, i, used)
|
||||||
|
if i == #list then g.height = area.height - used end
|
||||||
used = used + g.height
|
used = used + g.height
|
||||||
|
|
||||||
-- swap workarea dimensions
|
-- swap workarea dimensions
|
||||||
|
@ -94,6 +95,7 @@ local function tile_column(canvas, area, list, useless_gap, transformation, winf
|
||||||
-- useless gap and border correction
|
-- useless gap and border correction
|
||||||
size_correction(c, g, useless_gap)
|
size_correction(c, g, useless_gap)
|
||||||
|
|
||||||
|
|
||||||
c:geometry(g)
|
c:geometry(g)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -161,7 +163,7 @@ local function tile(p, orientation)
|
||||||
local master_area = {
|
local master_area = {
|
||||||
x = wa.x,
|
x = wa.x,
|
||||||
y = wa.y,
|
y = wa.y,
|
||||||
width = nmaster > 0 and wa.width * mwfact or 0,
|
width = nmaster > 0 and math.floor(wa.width * mwfact) or 0,
|
||||||
height = wa.height
|
height = wa.height
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,6 +188,7 @@ local function tile(p, orientation)
|
||||||
local rows_min = math.floor(#cls_other / ncol)
|
local rows_min = math.floor(#cls_other / ncol)
|
||||||
|
|
||||||
local client_index = 1
|
local client_index = 1
|
||||||
|
local used = 0
|
||||||
for i = 1, ncol do
|
for i = 1, ncol do
|
||||||
local position = transformation.flip and ncol - i + 1 or i
|
local position = transformation.flip and ncol - i + 1 or i
|
||||||
local rows = i <= last_small_column and rows_min or rows_min + 1
|
local rows = i <= last_small_column and rows_min or rows_min + 1
|
||||||
|
@ -198,6 +201,8 @@ local function tile(p, orientation)
|
||||||
|
|
||||||
-- and tile
|
-- and tile
|
||||||
local column_area = cut_column(other_area, ncol, position)
|
local column_area = cut_column(other_area, ncol, position)
|
||||||
|
if i == ncol then column_area.width = other_area.width - used end
|
||||||
|
used = used + column_area.width
|
||||||
|
|
||||||
if not data[i] then data[i] = {} end
|
if not data[i] then data[i] = {} end
|
||||||
tile_column(wa, column_area, column, useless_gap, transformation, data[i])
|
tile_column(wa, column_area, column, useless_gap, transformation, data[i])
|
||||||
|
|
|
@ -113,8 +113,7 @@ function calendar:attach(widget, args)
|
||||||
calendar.cal = args.cal or "/usr/bin/cal"
|
calendar.cal = args.cal or "/usr/bin/cal"
|
||||||
calendar.post_cal = args.post_cal or ""
|
calendar.post_cal = args.post_cal or ""
|
||||||
calendar.icons = args.icons or icons_dir .. "cal/white/"
|
calendar.icons = args.icons or icons_dir .. "cal/white/"
|
||||||
calendar.font = args.font or beautiful.font:sub(beautiful.font:find(""),
|
calendar.font = args.font or beautiful.font:gsub(" %d.*", "")
|
||||||
beautiful.font:find(" "))
|
|
||||||
calendar.font_size = tonumber(args.font_size) or 11
|
calendar.font_size = tonumber(args.font_size) or 11
|
||||||
calendar.fg = args.fg or beautiful.fg_normal or "#FFFFFF"
|
calendar.fg = args.fg or beautiful.fg_normal or "#FFFFFF"
|
||||||
calendar.bg = args.bg or beautiful.bg_normal or "#000000"
|
calendar.bg = args.bg or beautiful.bg_normal or "#000000"
|
||||||
|
|
2
wiki
2
wiki
|
@ -1 +1 @@
|
||||||
Subproject commit a24a74924b80b7293d0f4171a855f1eb23ab90cc
|
Subproject commit d7aa1a7b8428211a1c4c71865fd64302e013d62b
|
Loading…
Reference in New Issue