summaryrefslogtreecommitdiff
path: root/examples/js/simple-bar/widget/Bar.tsx
diff options
context:
space:
mode:
authorkotontrion <[email protected]>2024-12-20 09:49:58 +0100
committerkotontrion <[email protected]>2024-12-20 09:49:58 +0100
commitfcef5cea5ca84fa06a74e69de34e84b4d0842fcc (patch)
tree798de065ecce20a6f5892bc729ef73455abe209c /examples/js/simple-bar/widget/Bar.tsx
parent5ed7a1416c2532188a7e01fead3842602fdb670f (diff)
parentd7d11b341db85ce9768fa06b6f225d713621ec56 (diff)
Merge branch 'main' into feat/wayland-glib
Diffstat (limited to 'examples/js/simple-bar/widget/Bar.tsx')
-rw-r--r--examples/js/simple-bar/widget/Bar.tsx23
1 files changed, 9 insertions, 14 deletions
diff --git a/examples/js/simple-bar/widget/Bar.tsx b/examples/js/simple-bar/widget/Bar.tsx
index 8a0126e..54a14b0 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>
}
@@ -95,6 +89,7 @@ function Workspaces() {
return <box className="Workspaces">
{bind(hypr, "workspaces").as(wss => wss
+ .filter(ws => !(ws.id >= -99 && ws.id <= -2)) // filter out special workspaces
.sort((a, b) => a.id - b.id)
.map(ws => (
<button