diff options
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/volumedropdown.lua | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/widgets/volumedropdown.lua b/widgets/volumedropdown.lua index 796a84d..d669b46 100644 --- a/widgets/volumedropdown.lua +++ b/widgets/volumedropdown.lua @@ -149,7 +149,13 @@ end) default_sink_scrollbox:connect_signal("button::press", function() widget.dropdown.visible = true -- make sure widget isn't hidden - local menuopts = { items = {}, theme = { width = 225 } } + local g = mouse.current_widget_geometry + local menugeo = { + x = widget.dropdown.x + g.x - beautiful.margin_topbottom, + y = widget.dropdown.y + g.y + g.height + beautiful.margin_topbottom + (beautiful.border_width * 2), + width = g.width + beautiful.margin_topbottom * 2, + } + local menuopts = { items = {}, theme = menugeo } for i, s in pairs(pavolctld.sinks.sinks) do table.insert(menuopts.items, { s.desc, @@ -157,7 +163,8 @@ default_sink_scrollbox:connect_signal("button::press", function() }) end - awful.menu(menuopts):show() + if widget._menu then widget._menu:hide() end + widget._menu = awful.menu(menuopts):show({ coords = menugeo }) end) -- mute button |