21 lines
512 B
Lua
21 lines
512 B
Lua
local BASE = (...):gsub('columns$', '')
|
|
|
|
local Layout = require(BASE..'layout')
|
|
|
|
-- Advance position to next column,
|
|
-- given current position, widget dimensions and padding.
|
|
local function columnadvance(x,y, ww,wh, padding)
|
|
return x + ww + padding, y
|
|
end
|
|
|
|
local Columns = setmetatable({
|
|
advance = columnadvance,
|
|
__call = function(cls, args) return cls.new(args) end
|
|
}, Layout)
|
|
Columns.__index = Columns
|
|
|
|
|
|
function Columns.new(args) return setmetatable(Layout.new(args), Columns) end
|
|
|
|
return Columns
|