2013-08-03 07:03:43 +02:00
|
|
|
local setmetatable = setmetatable
|
|
|
|
local wibox = require("wibox")
|
|
|
|
|
|
|
|
local beautiful = require( "beautiful" )
|
|
|
|
|
|
|
|
local module = {}
|
|
|
|
|
|
|
|
local function new(data,text,args)
|
2016-06-24 22:53:47 +02:00
|
|
|
args = args or {}
|
2016-06-24 06:46:41 +02:00
|
|
|
local bg = wibox.container.background()
|
2013-08-03 07:03:43 +02:00
|
|
|
local infoHeader = wibox.widget.textbox()
|
|
|
|
infoHeader:set_font("")
|
|
|
|
infoHeader:set_markup( " <span color='".. beautiful.bg_normal .."' font='DejaVu Sans Mono' size='small' font_weight='bold'>".. text .."</span> " )
|
|
|
|
local l = wibox.layout.align.horizontal()
|
|
|
|
l:set_left(infoHeader)
|
|
|
|
bg:set_widget(l)
|
|
|
|
bg:set_bg(data.bg_header)
|
|
|
|
if args.suffix_widget then
|
|
|
|
l:set_right(args.suffix_widget)
|
|
|
|
end
|
|
|
|
return bg
|
|
|
|
end
|
|
|
|
|
|
|
|
return setmetatable(module, { __call = function(_, ...) return new(...) end })
|
|
|
|
-- kate: space-indent on; indent-width 2; replace-tabs on;
|