summaryrefslogtreecommitdiff
path: root/examples/lua/simple-bar/widget/Bar.lua
diff options
context:
space:
mode:
authorkotontrion <[email protected]>2024-11-16 12:07:28 +0100
committerkotontrion <[email protected]>2024-11-16 12:07:28 +0100
commit3c33226dc7c1636194491842c43dd3dd8945d3d0 (patch)
treeff4abcd4ffd5e2651346264a04e95272f348c1c3 /examples/lua/simple-bar/widget/Bar.lua
parentce64b076e6930dfc499d889ad992191a4fbb7b11 (diff)
lua: add actionGroup property
Diffstat (limited to 'examples/lua/simple-bar/widget/Bar.lua')
-rw-r--r--examples/lua/simple-bar/widget/Bar.lua26
1 files changed, 9 insertions, 17 deletions
diff --git a/examples/lua/simple-bar/widget/Bar.lua b/examples/lua/simple-bar/widget/Bar.lua
index bf230bb..843e292 100644
--- a/examples/lua/simple-bar/widget/Bar.lua
+++ b/examples/lua/simple-bar/widget/Bar.lua
@@ -19,24 +19,16 @@ local function SysTray()
return Widget.Box({
bind(tray, "items"):as(function(items)
return map(items, function(item)
- if item.icon_theme_path ~= nil then
- App:add_icons(item.icon_theme_path)
- end
-
- local menu = item:create_menu()
-
- return Widget.Button({
+ return Widget.MenuButton({
tooltip_markup = bind(item, "tooltip_markup"),
- on_destroy = function()
- if menu ~= nil then
- menu:destroy()
- end
- end,
- on_click_release = function(self)
- if menu ~= nil then
- menu:popup_at_widget(self, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, nil)
- end
- end,
+ use_popover = false,
+ menu_model = bind(item, "menu-model"),
+ action_group = bind(item, "action-group"):as(function(ag)
+ return {
+ prefix = "dbusmenu",
+ action_group = ag
+ }
+ end),
Widget.Icon({
g_icon = bind(item, "gicon"),
}),