2013-05-11 21:02:42 +02:00
|
|
|
local setmetatable = setmetatable
|
2016-02-11 07:36:50 +01:00
|
|
|
local color = require( "gears.color" )
|
|
|
|
local wibox = require( "wibox" )
|
|
|
|
local theme = require( "radical.theme" )
|
2013-05-11 21:02:42 +02:00
|
|
|
|
|
|
|
local module = {
|
|
|
|
margins = {
|
|
|
|
TOP = 2,
|
|
|
|
BOTTOM = 2,
|
|
|
|
RIGHT = 0,
|
|
|
|
LEFT = 4
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-11 07:36:50 +01:00
|
|
|
local function horizontal(self, context, cr, width, height)
|
|
|
|
if self._item and self._shape_border_color then
|
|
|
|
cr:set_source(color(self._shape_border_color))
|
|
|
|
cr:rectangle(0, height -1, width, 1)
|
|
|
|
cr:fill()
|
|
|
|
end
|
2013-05-11 21:02:42 +02:00
|
|
|
end
|
|
|
|
|
2016-02-11 07:36:50 +01:00
|
|
|
local function vertical(self, context, cr, width, height)
|
|
|
|
if self._item and self._shape_border_color then
|
|
|
|
cr:set_source(color(self._shape_border_color))
|
|
|
|
cr:rectangle(width-1, 0, 1, height)
|
|
|
|
cr:fill()
|
2015-12-29 11:19:23 +01:00
|
|
|
end
|
2014-02-15 05:35:53 +01:00
|
|
|
end
|
|
|
|
|
2013-05-11 21:02:42 +02:00
|
|
|
|
2016-02-11 07:36:50 +01:00
|
|
|
local function draw(item, v)
|
|
|
|
item.widget.border_color = color(item.item_border_color or item.border_color)
|
|
|
|
item.widget.after_draw_children = v and vertical or horizontal
|
2014-02-21 04:29:40 +01:00
|
|
|
|
2016-02-11 07:36:50 +01:00
|
|
|
theme.update_colors(item)
|
2013-05-11 21:02:42 +02:00
|
|
|
end
|
|
|
|
|
2016-02-11 07:36:50 +01:00
|
|
|
module.vertical = setmetatable({margins={
|
|
|
|
TOP = 2,
|
|
|
|
BOTTOM = 2,
|
|
|
|
RIGHT = 4,
|
|
|
|
LEFT = 4
|
|
|
|
}},{ __call = function(_, item) draw(item,true) end }
|
|
|
|
)
|
|
|
|
|
|
|
|
return setmetatable(module, { __call = function(_, item) draw(item) end })
|
2013-05-11 21:02:42 +02:00
|
|
|
-- kate: space-indent on; indent-width 2; replace-tabs on;
|