From 717efb9ae490351204a4b7548381778056335685 Mon Sep 17 00:00:00 2001 From: lukash Date: Tue, 27 Oct 2009 22:44:43 +0100 Subject: [PATCH] awful.widget: few formal fixes for widget layouts Signed-off-by: Lukas Hrazky Signed-off-by: Julien Danjou --- lib/awful/widget/layout/grid.lua.in | 7 ++----- lib/awful/widget/layout/init.lua.in | 2 +- lib/awful/widget/layout/linear_common.lua.in | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/awful/widget/layout/grid.lua.in b/lib/awful/widget/layout/grid.lua.in index ede33760..632ee6a4 100644 --- a/lib/awful/widget/layout/grid.lua.in +++ b/lib/awful/widget/layout/grid.lua.in @@ -18,8 +18,6 @@ local clone = util.table.clone local margins = awful.widget.layout.margins local layout = awful.widget.layout ---module("awful.widget.layout.grid") - local M = {} @@ -79,7 +77,7 @@ end -- Places the widgets in a grid. -- @see awful.widget.layout for a luadoc -local function grid(bounds, widgets, screen) +function M.grid(bounds, widgets, screen) local widths = {} local heights = {} @@ -197,7 +195,6 @@ local function grid(bounds, widgets, screen) return geometries end ---setmetatable(_M, { __call = function(_, ...) return grid(...) end }) -return grid +return M -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/lib/awful/widget/layout/init.lua.in b/lib/awful/widget/layout/init.lua.in index d0b3ce91..fea38724 100644 --- a/lib/awful/widget/layout/init.lua.in +++ b/lib/awful/widget/layout/init.lua.in @@ -85,6 +85,6 @@ require("awful.widget.layout.vertical") -- @return A table of geometries of all the widgets. -- @name grid -- @class function -grid = require("awful.widget.layout.grid") +grid = require("awful.widget.layout.grid").grid -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/lib/awful/widget/layout/linear_common.lua.in b/lib/awful/widget/layout/linear_common.lua.in index 9c6f168a..00c3fcec 100644 --- a/lib/awful/widget/layout/linear_common.lua.in +++ b/lib/awful/widget/layout/linear_common.lua.in @@ -245,7 +245,7 @@ function linear_common.flex(idx, bounds, widgets, screen) insert(geometries, v) end elseif type(v) == "widget" then - g = v:extents(screen) + local g = v:extents(screen) -- resize to fit the width available if requested if v.resize and g.width > 0 and g.height > 0 then