Add opacity option

This commit is contained in:
Emmanuel Lepage Vallee 2014-02-17 22:57:04 -05:00
parent cd88700613
commit 5a79549e59
3 changed files with 4 additions and 0 deletions

View File

@ -185,6 +185,7 @@ Multiple items can have multiple sets of options.
| sub_menu_on | Show submenu on selection or when clicking | see "event" enum | | sub_menu_on | Show submenu on selection or when clicking | see "event" enum |
| select_on | The event used to trigger item selection | see "event" enum | | select_on | The event used to trigger item selection | see "event" enum |
| overlay | A layer on top of the item | function(data,item,cr,w,h) | | overlay | A layer on top of the item | function(data,item,cr,w,h) |
| opacity | Make this menu translucent (require a compositor) | number (0 to 1) |
###Item options ###Item options
@ -289,5 +290,6 @@ Radical also use the some of the same theme options as awful.menu, plus some:
| menu_bg_highlight | Highlighted item background | String/Gradient/Pattern | | menu_bg_highlight | Highlighted item background | String/Gradient/Pattern |
| menu_submenu_icon | Sub menu pixmap (aka >) | Path/Pattern | | menu_submenu_icon | Sub menu pixmap (aka >) | Path/Pattern |
| menu_separator_color | Menu separator color | String/Gradient/Pattern | | menu_separator_color | Menu separator color | String/Gradient/Pattern |
| menu_opacity | Use your favorite compositor | Number (0=0%, 1=100%) |
| draw_underlay | Function returning the underlay pixmap | Function | | draw_underlay | Function returning the underlay pixmap | Function |

View File

@ -341,6 +341,7 @@ local function new(args)
sub_menu_on = args.sub_menu_on or module.event.SELECTED, sub_menu_on = args.sub_menu_on or module.event.SELECTED,
select_on = args.select_on or module.event.HOVER, select_on = args.select_on or module.event.HOVER,
overlay = args.overlay or nil, overlay = args.overlay or nil,
opacity = args.opacity or beautiful.menu_opacity or 1,
}, },
get_map = { get_map = {
is_menu = function() return true end, is_menu = function() return true end,

View File

@ -113,6 +113,7 @@ local function setup_drawable(data)
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) internal.w:set_fg(data.fg)
internal.w.opacity = data.opacity
--Getters --Getters
get_map.wibox = function() return internal.w end get_map.wibox = function() return internal.w end