2022-08-24 11:18:48 +02:00
|
|
|
local BASE = (...):gsub('columns$', '')
|
2022-08-15 23:41:17 +02:00
|
|
|
|
2022-08-16 00:23:52 +02:00
|
|
|
local Layout = require(BASE..'layout')
|
2022-08-15 23:41:17 +02:00
|
|
|
|
|
|
|
-- 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
|
|
|
|
|
2022-08-24 11:18:48 +02:00
|
|
|
local Columns = setmetatable({
|
|
|
|
advance = columnadvance,
|
|
|
|
__call = function(cls, args) return cls.new(args) end
|
|
|
|
}, Layout)
|
|
|
|
Columns.__index = Columns
|
2022-08-15 23:41:17 +02:00
|
|
|
|
2022-08-24 11:18:48 +02:00
|
|
|
|
|
|
|
function Columns.new(args) return setmetatable(Layout.new(args), Columns) end
|
2022-08-15 23:41:17 +02:00
|
|
|
|
|
|
|
return Columns
|