Try to fix issue #3 (I sill cannot reproduce it)
This commit is contained in:
parent
fc48ca261f
commit
10fb812c23
|
@ -110,7 +110,7 @@ Multiple items can have multiple sets of options.
|
||||||
| bg | Background color | String/gradient/pattern |
|
| bg | Background color | String/gradient/pattern |
|
||||||
| fg | Foreground (text) color | String/gradient/pattern |
|
| fg | Foreground (text) color | String/gradient/pattern |
|
||||||
| bg_focus | Background of focussed items | String/gradient/pattern |
|
| bg_focus | Background of focussed items | String/gradient/pattern |
|
||||||
| fg_forcus | Foreground of focussed items | String/gradient/pattern |
|
| fg_focus | Foreground of focussed items | String/gradient/pattern |
|
||||||
| bg_alternate | Alternate background color | String/gradient/pattern |
|
| bg_alternate | Alternate background color | String/gradient/pattern |
|
||||||
| bg_highlight | Highlight background color | String/gradient/pattern |
|
| bg_highlight | Highlight background color | String/gradient/pattern |
|
||||||
| bg_header | Header (see widgets section) color | String/gradient/pattern |
|
| bg_header | Header (see widgets section) color | String/gradient/pattern |
|
||||||
|
|
3
base.lua
3
base.lua
|
@ -231,7 +231,7 @@ local function new(args)
|
||||||
bg = args.bg or beautiful.menu_bg_normal or beautiful.bg_normal or "#000000",
|
bg = args.bg or beautiful.menu_bg_normal or beautiful.bg_normal or "#000000",
|
||||||
fg = args.fg or beautiful.menu_fg_normal or beautiful.fg_normal or "#ffffff",
|
fg = args.fg or beautiful.menu_fg_normal or beautiful.fg_normal or "#ffffff",
|
||||||
bg_focus = args.bg_focus or beautiful.menu_bg_focus or beautiful.bg_focus or "#ffffff",
|
bg_focus = args.bg_focus or beautiful.menu_bg_focus or beautiful.bg_focus or "#ffffff",
|
||||||
fg_forcus = args.fg_focus or beautiful.menu_fg_focus or beautiful.fg_focus or "#000000",
|
fg_focus = args.fg_focus or beautiful.menu_fg_focus or beautiful.fg_focus or "#000000",
|
||||||
bg_alternate = args.bg_alternate or beautiful.menu_bg_alternate or beautiful.bg_alternate or beautiful.bg_normal,
|
bg_alternate = args.bg_alternate or beautiful.menu_bg_alternate or beautiful.bg_alternate or beautiful.bg_normal,
|
||||||
bg_highlight = args.bg_highlight or beautiful.menu_bg_highlight or beautiful.bg_highlight or beautiful.bg_normal,
|
bg_highlight = args.bg_highlight or beautiful.menu_bg_highlight or beautiful.bg_highlight or beautiful.bg_normal,
|
||||||
bg_header = args.bg_header or beautiful.menu_bg_header or beautiful.fg_normal,
|
bg_header = args.bg_header or beautiful.menu_bg_header or beautiful.fg_normal,
|
||||||
|
@ -365,6 +365,7 @@ local function new(args)
|
||||||
-- data.style(data,{arrow_x=20,margin=internal.margin})
|
-- data.style(data,{arrow_x=20,margin=internal.margin})
|
||||||
else
|
else
|
||||||
data.has_changed = true
|
data.has_changed = true
|
||||||
|
internal.layout:emit_signal("widget::updated")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
|
@ -151,8 +151,11 @@ local function setup_drawable(data)
|
||||||
end
|
end
|
||||||
function internal:set_visible(value)
|
function internal:set_visible(value)
|
||||||
internal.w.visible = value
|
internal.w.visible = value
|
||||||
|
if not value then
|
||||||
|
capi.keygrabber.stop()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if data.visible then
|
if data.visible then
|
||||||
local fit_w,fit_h = data._internal.layout:fit()
|
local fit_w,fit_h = data._internal.layout:fit()
|
||||||
data.width = fit_w
|
data.width = fit_w
|
||||||
|
|
|
@ -104,6 +104,7 @@ function module:setup_item(data,item,args)
|
||||||
data.item_style(data,item,false,false)
|
data.item_style(data,item,false,false)
|
||||||
item.widget:set_fg(item._private_data.fg)
|
item.widget:set_fg(item._private_data.fg)
|
||||||
item._internal.has_changed = true
|
item._internal.has_changed = true
|
||||||
|
data._internal.layout:emit_signal("widget::updated")
|
||||||
|
|
||||||
--Event handling
|
--Event handling
|
||||||
item.widget:connect_signal("mouse::enter", function() item.selected = true end)
|
item.widget:connect_signal("mouse::enter", function() item.selected = true end)
|
||||||
|
@ -219,6 +220,7 @@ function module:setup_item(data,item,args)
|
||||||
data._internal.largest_item_w = item
|
data._internal.largest_item_w = item
|
||||||
data._internal.largest_item_w_v = fit_w
|
data._internal.largest_item_w_v = fit_w
|
||||||
end
|
end
|
||||||
|
data._internal.layout:emit_signal("widget::updated")
|
||||||
--TODO find new largest is item is smaller
|
--TODO find new largest is item is smaller
|
||||||
-- if data._internal.largest_item_h_v < fit_h then
|
-- if data._internal.largest_item_h_v < fit_h then
|
||||||
-- data._internal.largest_item_h =item
|
-- data._internal.largest_item_h =item
|
||||||
|
@ -229,6 +231,7 @@ function module:setup_item(data,item,args)
|
||||||
|
|
||||||
item._internal.set_map.f_key = function(value)
|
item._internal.set_map.f_key = function(value)
|
||||||
item._internal.has_changed = true
|
item._internal.has_changed = true
|
||||||
|
data._internal.layout:emit_signal("widget::updated")
|
||||||
item._internal.f_key = value
|
item._internal.f_key = value
|
||||||
data:remove_key_hook("F"..value)
|
data:remove_key_hook("F"..value)
|
||||||
data:add_key_hook({}, "F"..value , "press", function()
|
data:add_key_hook({}, "F"..value , "press", function()
|
||||||
|
|
Loading…
Reference in New Issue