summaryrefslogtreecommitdiff
path: root/widgets/volumedropdown.lua
diff options
context:
space:
mode:
authorTim Keller <tjkeller.xyz>2025-04-18 23:35:13 -0500
committerTim Keller <tjkeller.xyz>2025-04-18 23:35:13 -0500
commit428ce27f3004a8d7d367e87594da1b8d93241823 (patch)
tree9f46536844300d33ed01f7b7a005d33c2d5310b1 /widgets/volumedropdown.lua
parent8c3245410da7b2565fb0e5484d737cc3b427c548 (diff)
downloadawesome-428ce27f3004a8d7d367e87594da1b8d93241823.tar.xz
awesome-428ce27f3004a8d7d367e87594da1b8d93241823.zip
place menu under scrollbox
Diffstat (limited to 'widgets/volumedropdown.lua')
-rw-r--r--widgets/volumedropdown.lua11
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