naughty: fix beautiful support properly

Signed-off-by: koniu <gkusnierz@gmail.com>
This commit is contained in:
koniu 2008-11-21 00:43:18 +00:00 committed by Julien Danjou
parent c453d6c611
commit 64f0848940
1 changed files with 8 additions and 7 deletions

View File

@ -15,7 +15,6 @@ local widget = widget
local button = button local button = button
local capi = { screen = screen } local capi = { screen = screen }
local bt = require("beautiful") local bt = require("beautiful")
local beautiful = bt.get()
local screen = screen local screen = screen
--- Notification library --- Notification library
@ -58,12 +57,8 @@ config.width = 300
config.spacing = 1 config.spacing = 1
config.ontop = true config.ontop = true
config.margin = 10 config.margin = 10
config.font = beautiful.font or "Verdana 8"
config.icon = nil config.icon = nil
config.icon_size = 16 config.icon_size = 16
config.fg = beautiful.fg_focus or '#ffffff'
config.bg = beautiful.bg_focus or '#535d6c'
config.border_color = beautiful.border_focus or '#535d6c'
config.border_width = 1 config.border_width = 1
config.hover_timeout = nil config.hover_timeout = nil
@ -179,6 +174,12 @@ function notify(args)
local ontop = args.ontop or config.ontop local ontop = args.ontop or config.ontop
local width = args.width or config.width local width = args.width or config.width
-- beautiful
local beautiful = bt.get()
local font = args.font or config.font or beautiful.font or "Verdana 8"
local fg = args.fg or config.fg or beautiful.fg_normal or '#ffffff'
local bg = args.bg or config.bg or beautiful.bg_normal or '#535d6c'
local border_color = config.border_color or beautiful.bg_focus or '#535d6c'
local notification = {} local notification = {}
notification.position = args.position or config.position notification.position = args.position or config.position
notification.idx = #notifications[screen][notification.position] + 1 notification.idx = #notifications[screen][notification.position] + 1
@ -224,8 +225,8 @@ function notify(args)
-- create container wibox -- create container wibox
notification.box = wibox({ name = "not" .. notification.idx, notification.box = wibox({ name = "not" .. notification.idx,
position = "floating", position = "floating",
fg = args.fg or config.fg, fg = fg,
bg = args.bg or config.bg, bg = bg,
border_color = config.border_color, border_color = config.border_color,
border_width = config.border_width }) border_width = config.border_width })