X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/8af4a03c754fa1bcac24736633f1b3be8ce8888c..1f5ff7d118b6a86f0982755302f62551d10dfaa7:/layout/uselesstile.lua diff --git a/layout/uselesstile.lua b/layout/uselesstile.lua index cd288ed..e496500 100644 --- a/layout/uselesstile.lua +++ b/layout/uselesstile.lua @@ -21,11 +21,7 @@ local uselesstile = {} local function tile_group(cls, wa, orientation, fact, group) -- A useless gap (like the dwm patch) can be defined with -- beautiful.useless_gap_width . - local useless_gap = tonumber(beautiful.useless_gap_width) - if useless_gap == nil - then - useless_gap = 0 - end + local useless_gap = tonumber(beautiful.useless_gap_width) or 0 -- get our orientation right local height = "height" @@ -92,6 +88,8 @@ local function tile_group(cls, wa, orientation, fact, group) top = false left = false + gap_factor = (useless_gap / 100) * 2 + if geom[y] == wa[y] then top = true end @@ -101,17 +99,17 @@ local function tile_group(cls, wa, orientation, fact, group) end if top then - geom[height] = geom[height] - 2 * useless_gap + geom[height] = geom[height] - (2 + gap_factor) * useless_gap geom[y] = geom[y] + useless_gap else - geom[height] = geom[height] - useless_gap + geom[height] = geom[height] - (1 + gap_factor) * useless_gap end if left then - geom[width] = geom[width] - 2 * useless_gap + geom[width] = geom[width] - (2 + gap_factor) * useless_gap geom[x] = geom[x] + useless_gap else - geom[width] = geom[width] - useless_gap + geom[width] = geom[width] - (1 + gap_factor) * useless_gap end end -- End of useless gap.