diff options
author | Aylur <[email protected]> | 2024-12-19 23:44:18 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-12-19 23:44:18 +0100 |
commit | c34349ca44c4e43bf2c58b3e2e4f1f9e39358b53 (patch) | |
tree | 604bdece8e3fe3bd2a286ab1e8ef07dd8d90c37c /examples/js/simple-bar/widget/Bar.tsx | |
parent | 4f47b69946dd7127ba66e6333af4945afaba15de (diff) | |
parent | c5664e2941b33609de0743a8475a40b24522a3dc (diff) |
Merge pull request #68 from Aylur/feat/tray-gtk4
tray: gtk4 compatibility
Diffstat (limited to 'examples/js/simple-bar/widget/Bar.tsx')
-rw-r--r-- | examples/js/simple-bar/widget/Bar.tsx | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/examples/js/simple-bar/widget/Bar.tsx b/examples/js/simple-bar/widget/Bar.tsx index 8a0126e..87cc20d 100644 --- a/examples/js/simple-bar/widget/Bar.tsx +++ b/examples/js/simple-bar/widget/Bar.tsx @@ -11,22 +11,16 @@ import Tray from "gi://AstalTray" function SysTray() { const tray = Tray.get_default() - 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 <box className="SysTray"> + {bind(tray, "items").as(items => items.map(item => ( + <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 => ["dbusmenu", ag])} + menuModel={bind(item, "menu-model")}> <icon gIcon={bind(item, "gicon")} /> - </button> - }))} + </menubutton> + ))} </box> } |