diff options
author | kotontrion <[email protected]> | 2024-11-16 11:48:43 +0100 |
---|---|---|
committer | kotontrion <[email protected]> | 2024-11-16 11:48:43 +0100 |
commit | ce64b076e6930dfc499d889ad992191a4fbb7b11 (patch) | |
tree | 4059bf8ef5bf0c2a9b6cc7a7251fde877eb8e56f /examples/js/simple-bar/widget/Bar.tsx | |
parent | 07bcaf9c26a28ac6afbbab73bb7660c0b32efc30 (diff) |
gjs: add actionGroup property
Diffstat (limited to 'examples/js/simple-bar/widget/Bar.tsx')
-rw-r--r-- | examples/js/simple-bar/widget/Bar.tsx | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/examples/js/simple-bar/widget/Bar.tsx b/examples/js/simple-bar/widget/Bar.tsx index efc065a..029aca1 100644 --- a/examples/js/simple-bar/widget/Bar.tsx +++ b/examples/js/simple-bar/widget/Bar.tsx @@ -13,19 +13,14 @@ function SysTray() { return <box> {bind(tray, "items").as(items => items.map(item => { - if (item.iconThemePath) - App.add_icons(item.iconThemePath) - - const menu = item.create_menu() - - return <button + + return <menubutton tooltipMarkup={bind(item, "tooltipMarkup")} - onDestroy={() => menu?.destroy()} - onClickRelease={self => { - menu?.popup_at_widget(self, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null) - }}> + usePopover={false} + actionGroup={bind(item, "action-group").as(ag => { return { prefix: "dbusmenu", actionGroup: ag}})} + menuModel={bind(item, "menu-model")} > <icon gIcon={bind(item, "gicon")} /> - </button> + </menubutton> }))} </box> } |