X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/f7aa28919588d307083b4b5b1c010f26cbc63cde..166bb8483762fe6aec5be4b515ccb00fc54be1a7:/layout/uselesstile.lua?ds=inline 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.