awful.layout.suit: remove tile

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-01-28 12:05:21 +01:00
parent d95a16e837
commit ed2581c3ec
18 changed files with 0 additions and 229 deletions

View File

@ -64,10 +64,6 @@ end
local layouts_name =
{
[suit.tile] = "tile",
[suit.tile.left] = "tileleft",
[suit.tile.bottom] = "tilebottom",
[suit.tile.top] = "tiletop",
[suit.vile] = "vile",
[suit.vile.left] = "vileleft",
[suit.vile.bottom] = "vilebottom",

View File

@ -1,5 +1,4 @@
require("awful.layout.suit.max")
require("awful.layout.suit.tile")
require("awful.layout.suit.vile")
require("awful.layout.suit.fair")
require("awful.layout.suit.floating")

View File

@ -1,168 +0,0 @@
---------------------------------------------------------------------------
-- @author Julien Danjou &lt;julien@danjou.info&gt;
-- @copyright 2008 Julien Danjou
-- @release @AWESOME_VERSION@
---------------------------------------------------------------------------
-- Grab environment we need
local setmetatable = setmetatable
local ipairs = ipairs
local math = math
local client = require("awful.client")
local tag = require("awful.tag")
local capi =
{
screen = screen
}
--- Tiled layouts module for awful
module("awful.layout.suit.tile")
local function tile(_, screen, position)
if not position then position = "right" end
local t = tag.selected(screen)
local nmaster = tag.getnmaster(t)
local mwfact = tag.getmwfact(t)
local ncol = tag.getncol(t)
local wa = capi.screen[screen].workarea
local cls = client.tiled(screen)
local masterwin = math.min(#cls, nmaster)
local otherwin = math.max(#cls - masterwin, 0);
local mh, mw
if nmaster > 0 then
if position == "right" or position == "left" then
if masterwin > 0 then
mh = wa.height / masterwin
else
mh = wa.height
end
if otherwin > 0 then
mw = wa.width * mwfact
else
mw = wa.width
end
else
if otherwin > 0 then
mh = wa.height * mwfact
else
mh = wa.height
end
if masterwin > 0 then
mw = wa.width / masterwin
else
mw = wa.width
end
end
else
mh = 0
mw = 0
end
local real_ncol
if ncol > 0 then
real_ncol = math.min(otherwin, ncol)
else
real_ncol = math.min(otherwin, 1)
end
for i, c in ipairs(cls) do
local geometry = {}
-- Master windows
if i <= nmaster then
if position == "right" then
geometry.y = wa.y + (i - 1) * mh
geometry.x = wa.x
elseif position == "left" then
geometry.y = wa.y + (i - 1) * mh
geometry.x = wa.x + (wa.width - mw)
elseif position == "top" then
geometry.x = wa.x + (i - 1) * mw
geometry.y = wa.y + (wa.height - mh)
else
geometry.x = wa.x + (i - 1) * mw
geometry.y = wa.y
end
geometry.width = mw
geometry.height = mh
-- Slave windows
else
local win_by_col = math.ceil(otherwin / real_ncol)
real_ncol = math.ceil(otherwin / win_by_col)
local current_col = math.floor((i - 1 - nmaster) / win_by_col)
if position == "right" or position == "left" then
if otherwin <= real_ncol then
geometry.height = wa.height
elseif (otherwin % win_by_col) ~= 0 and (current_col == real_ncol - 1) then
geometry.height = math.floor(wa.height / (otherwin % win_by_col))
else
geometry.height = math.floor(wa.height / win_by_col)
end
geometry.width = math.floor((wa.width - mw) / real_ncol)
if otherwin <= real_ncol then
geometry.y = wa.y
else
geometry.y = wa.y + ((i - 1 - nmaster) % win_by_col) *
geometry.height
end
geometry.x = wa.x + current_col * geometry.width
if position == "right" then
geometry.x = geometry.x + mw
end
else
if otherwin <= real_ncol then
geometry.width = wa.width
elseif (otherwin % win_by_col) ~= 0 and (current_col == real_ncol - 1) then
geometry.width = math.floor(wa.width / (otherwin % win_by_col))
else
geometry.width = math.floor(wa.width / win_by_col)
end
geometry.height = math.floor((wa.height - mh) / real_ncol)
if otherwin <= real_ncol then
geometry.x = wa.x
else
geometry.x = wa.x + ((i - 1 - nmaster) % win_by_col) *
geometry.width
end
geometry.y = wa.y + current_col * geometry.height
if position == "bottom" then
geometry.y = geometry.y + mh
end
end
end
c:geometry(geometry)
end
end
--- The main tile algo, on left.
-- @param screen The screen number to tile.
function left(screen)
return tile(nil, screen, "left")
end
--- The main tile algo, on bottom.
-- @param screen The screen number to tile.
function bottom(screen)
return tile(nil, screen, "bottom")
end
--- The main tile algo, on top.
-- @param screen The screen number to tile.
function top(screen)
return tile(nil, screen, "top")
end
setmetatable(_M, { __call = tile })

View File

@ -349,49 +349,6 @@ local function client_resize_magnifier(c, corner)
end, corner .. "_corner")
end
local function client_resize_tiled(c, lay)
local wa = capi.screen[c.screen].workarea
local mwfact = tag.getmwfact()
local cursor
if lay == layout.suit.tile then
capi.mouse.coords({ x = wa.x + wa.width * mwfact })
cursor = "sb_h_double_arrow"
elseif lay == layout.suit.tile.left then
capi.mouse.coords({ x = wa.x + wa.width * (1 - mwfact) })
cursor = "sb_h_double_arrow"
elseif lay == layout.suit.tile.bottom then
capi.mouse.coords({ y = wa.y + wa.height * mwfact })
cursor = "sb_v_double_arrow"
else
capi.mouse.coords({ y = wa.y + wa.height * (1 - mwfact) })
cursor = "sb_v_double_arrow"
end
capi.mousegrabber.run(function (mouse)
for k, v in ipairs(mouse.buttons) do
if v then
local fact_x = (mouse.x - wa.x) / wa.width
local fact_y = (mouse.y - wa.y) / wa.height
local mwfact
if lay == layout.suit.tile then
mwfact = fact_x
elseif lay == layout.suit.tile.left then
mwfact = 1 - fact_x
elseif lay == layout.suit.tile.bottom then
mwfact = fact_y
else
mwfact = 1 - fact_y
end
tag.setmwfact(math.min(math.max(mwfact, 0.01), 0.99), tag.selected(c.screen))
return true
end
end
return false
end, cursor)
end
local function client_resize_viled(c, lay)
local wa = capi.screen[c.screen].workarea
local mwfact = tag.getmwfact()
@ -572,11 +529,6 @@ function client.resize(c, corner)
if lay == layout.suit.floating or aclient.floating.get(c) then
return client_resize_floating(c, corner, fixed_x, fixed_y)
elseif lay == layout.suit.tile
or lay == layout.suit.tile.left
or lay == layout.suit.tile.top
or lay == layout.suit.tile.bottom then
return client_resize_tiled(c, lay)
elseif lay == layout.suit.vile
or lay == layout.suit.vile.left
or lay == layout.suit.vile.top

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

View File

@ -56,10 +56,6 @@ layout_fairv = @AWESOME_THEMES_PATH@/default/layouts/fairvw.png
layout_floating = @AWESOME_THEMES_PATH@/default/layouts/floatingw.png
layout_magnifier = @AWESOME_THEMES_PATH@/default/layouts/magnifierw.png
layout_max = @AWESOME_THEMES_PATH@/default/layouts/maxw.png
layout_tilebottom = @AWESOME_THEMES_PATH@/default/layouts/tilebottomw.png
layout_tileleft = @AWESOME_THEMES_PATH@/default/layouts/tileleftw.png
layout_tile = @AWESOME_THEMES_PATH@/default/layouts/tilew.png
layout_tiletop = @AWESOME_THEMES_PATH@/default/layouts/tiletopw.png
layout_vilebottom = @AWESOME_THEMES_PATH@/default/layouts/vilebottomw.png
layout_vileleft = @AWESOME_THEMES_PATH@/default/layouts/vileleftw.png
layout_vile = @AWESOME_THEMES_PATH@/default/layouts/vilew.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 B

View File

@ -27,10 +27,6 @@ layout_floating = @AWESOME_THEMES_PATH@/sky/layouts/floating.png
layout_magnifier = @AWESOME_THEMES_PATH@/sky/layouts/magnifier.png
layout_max = @AWESOME_THEMES_PATH@/sky/layouts/max.png
layout_fullscreen = @AWESOME_THEMES_PATH@/sky/layouts/fullscreen.png
layout_tilebottom = @AWESOME_THEMES_PATH@/sky/layouts/tilebottom.png
layout_tileleft = @AWESOME_THEMES_PATH@/sky/layouts/tileleft.png
layout_tile = @AWESOME_THEMES_PATH@/sky/layouts/tile.png
layout_tiletop = @AWESOME_THEMES_PATH@/sky/layouts/tiletop.png
layout_vilebottom = @AWESOME_THEMES_PATH@/sky/layouts/vilebottom.png
layout_vileleft = @AWESOME_THEMES_PATH@/sky/layouts/vileleft.png
layout_vile = @AWESOME_THEMES_PATH@/sky/layouts/vile.png