Add bg/fg pattern support

This commit is contained in:
Emmanuel Lepage Vallee 2013-07-13 01:05:46 -04:00
parent 1a03ad281a
commit e8027779dc
4 changed files with 4 additions and 2 deletions

View File

@ -88,6 +88,7 @@ local function setup_drawable(data)
internal.w.ontop = true internal.w.ontop = true
internal.margin:set_widget(internal.layout) internal.margin:set_widget(internal.layout)
internal.w:set_widget(internal.margin) internal.w:set_widget(internal.margin)
internal.w:set_fg(data.fg)
--Getters --Getters
get_map.wibox = function() return internal.w end get_map.wibox = function() return internal.w end

View File

@ -14,7 +14,7 @@ local function draw(data,item,is_focussed,is_pressed)
if is_focussed then if is_focussed then
item.widget:set_bg(data.bg_focus) item.widget:set_bg(data.bg_focus)
else else
item.widget:set_bg(data.bg) item.widget:set_bg(nil)
end end
end end

View File

@ -293,6 +293,7 @@ local function new(data)
if not data.visible then return 1,1 end if not data.visible then return 1,1 end
local result,r2 = wibox.layout.fixed.fit(a1,99999,99999) local result,r2 = wibox.layout.fixed.fit(a1,99999,99999)
local total = data._total_item_height local total = data._total_item_height
print("salut",compute_geo(data))
return compute_geo(data) return compute_geo(data)
end end
real_l.add = function(real_l,item) real_l.add = function(real_l,item)

View File

@ -53,7 +53,7 @@ end
local function set_direction(data,direction) local function set_direction(data,direction)
local geometry = (direction == "left" or direction == "right") and {width = data.wibox.height, height = data.wibox.width} or {height = data.wibox.height, width = data.wibox.width} local geometry = (direction == "left" or direction == "right") and {width = data.wibox.height, height = data.wibox.width} or {height = data.wibox.height, width = data.wibox.width}
local top_clip_surface = do_gen_menu_top(data,geometry.width,geometry.height,10,data.border_width,{bg=beautiful.fg_normal or "#0000ff",fg=beautiful.bg_normal or "#00ffff"}) local top_clip_surface = do_gen_menu_top(data,geometry.width,geometry.height,10,data.border_width,{bg=beautiful.fg_normal or "#0000ff",fg=data.bg or "#00ffff"})
local top_bounding_surface = do_gen_menu_top(data,geometry.width,geometry.height,10,0,{bg="#00000000",fg="#ffffffff"}) local top_bounding_surface = do_gen_menu_top(data,geometry.width,geometry.height,10,0,{bg="#00000000",fg="#ffffffff"})
local arr_margin,angle,mar_func = (data.arrow_type == base.arrow_type.NONE) and 0 or 13,0 local arr_margin,angle,mar_func = (data.arrow_type == base.arrow_type.NONE) and 0 or 13,0