2014-11-15 05:46:06 +01:00
|
|
|
local holo = require("radical.item.style.holo")
|
2015-01-11 05:59:51 +01:00
|
|
|
local rounded = require("radical.item.style.rounded" )
|
2016-02-21 08:34:05 +01:00
|
|
|
local theme = require( "radical.theme" )
|
|
|
|
local unpack = unpack or table.unpack
|
2014-11-15 05:46:06 +01:00
|
|
|
|
2016-02-21 08:34:05 +01:00
|
|
|
-- Create a generic item_style
|
|
|
|
local function generic(_, args)
|
2016-06-24 22:53:47 +02:00
|
|
|
args = args or {}
|
2016-02-21 08:34:05 +01:00
|
|
|
|
|
|
|
args.margins = args.margins or {
|
|
|
|
TOP = 0,
|
|
|
|
BOTTOM = 0,
|
|
|
|
RIGHT = 0,
|
|
|
|
LEFT = 0
|
|
|
|
}
|
|
|
|
|
|
|
|
local module = {
|
|
|
|
margins = args.margins
|
|
|
|
}
|
|
|
|
|
|
|
|
local function draw(item)
|
2016-03-14 22:52:28 +01:00
|
|
|
item.widget:set_shape(args.shape or item.shape, unpack(args.shape_args or {}))
|
2016-02-21 08:34:05 +01:00
|
|
|
item.widget:set_shape_border_width(item.border_width)
|
|
|
|
theme.update_colors(item)
|
|
|
|
end
|
|
|
|
|
|
|
|
return setmetatable(module, { __call = function(_, ...) return draw(...) end })
|
|
|
|
end
|
|
|
|
|
|
|
|
return setmetatable({
|
2015-01-11 05:59:51 +01:00
|
|
|
basic = require("radical.item.style.basic" ),
|
|
|
|
classic = require("radical.item.style.classic" ),
|
|
|
|
rounded_shadow = rounded.shadow ,
|
|
|
|
rounded = rounded ,
|
|
|
|
holo = holo ,
|
|
|
|
holo_top = holo.top ,
|
|
|
|
arrow_prefix = require("radical.item.style.arrow_prefix" ),
|
|
|
|
arrow_single = require("radical.item.style.arrow_single" ),
|
|
|
|
arrow_3d = require("radical.item.style.arrow_3d" ),
|
|
|
|
slice_prefix = require("radical.item.style.slice_prefix" ),
|
|
|
|
line_3d = require("radical.item.style.line_3d" ),
|
2016-02-21 08:34:05 +01:00
|
|
|
}, {__call=generic})
|