2013-05-11 21:02:42 +02:00
|
|
|
local setmetatable = setmetatable
|
|
|
|
local print = print
|
2014-01-08 06:59:57 +01:00
|
|
|
local pairs=pairs
|
|
|
|
local base = require( "radical.base" )
|
2013-05-11 21:02:42 +02:00
|
|
|
|
|
|
|
local module = {
|
|
|
|
margins = {
|
|
|
|
TOP = 2,
|
|
|
|
BOTTOM = 2,
|
|
|
|
RIGHT = 2,
|
|
|
|
LEFT = 4
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-08 06:59:57 +01:00
|
|
|
local function draw(data,item,args)
|
|
|
|
local args,flags = args or {},{}
|
2014-01-13 06:46:33 +01:00
|
|
|
for _,v in pairs(args) do flags[v] = true end
|
2014-01-08 06:59:57 +01:00
|
|
|
|
|
|
|
if flags[base.item_flags.SELECTED] or (item._tmp_menu) then
|
|
|
|
item.widget:set_bg(args.color or data.bg_focus)
|
2013-05-11 21:02:42 +02:00
|
|
|
else
|
2014-01-08 06:59:57 +01:00
|
|
|
item.widget:set_bg(args.color or nil)
|
2013-05-11 21:02:42 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return setmetatable(module, { __call = function(_, ...) return draw(...) end })
|
|
|
|
-- kate: space-indent on; indent-width 2; replace-tabs on;
|