radical/widgets/header.lua

30 lines
964 B
Lua
Raw Normal View History

2013-08-03 07:03:43 +02:00
local setmetatable = setmetatable
local print = print
local color = require("gears.color")
local cairo = require( "lgi" ).cairo
local wibox = require("wibox")
local beautiful = require( "beautiful" )
local module = {}
local function new(data,text,args)
local args = args or {}
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()
print("\n\n\nAAAAAAAAAA",l.set_first, l.set_left)
2013-08-03 07:03:43 +02:00
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;