From 428ce27f3004a8d7d367e87594da1b8d93241823 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Fri, 18 Apr 2025 23:35:13 -0500 Subject: place menu under scrollbox --- widgets/volumedropdown.lua | 11 +++++++++-- 1 file 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 -- cgit v1.2.3