From ce64b076e6930dfc499d889ad992191a4fbb7b11 Mon Sep 17 00:00:00 2001 From: kotontrion Date: Sat, 16 Nov 2024 11:48:43 +0100 Subject: gjs: add actionGroup property --- examples/js/simple-bar/widget/Bar.tsx | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'examples/js') 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 {bind(tray, "items").as(items => items.map(item => { - if (item.iconThemePath) - App.add_icons(item.iconThemePath) - - const menu = item.create_menu() - - return + }))} } -- cgit v1.2.3 From c5664e2941b33609de0743a8475a40b24522a3dc Mon Sep 17 00:00:00 2001 From: Aylur Date: Thu, 19 Dec 2024 23:42:33 +0100 Subject: update examples, fix styling --- examples/js/simple-bar/style.scss | 50 ++++++++++++++++++++++------------- examples/js/simple-bar/widget/Bar.tsx | 13 +++++---- 2 files changed, 38 insertions(+), 25 deletions(-) (limited to 'examples/js') diff --git a/examples/js/simple-bar/style.scss b/examples/js/simple-bar/style.scss index 1dcf729..f5f771a 100644 --- a/examples/js/simple-bar/style.scss +++ b/examples/js/simple-bar/style.scss @@ -13,31 +13,45 @@ window.Bar { font-size: 1.1em; font-weight: bold; - button { - all: unset; - background-color: transparent; + label { + margin: 0 8px; + } + + .Workspaces { + button { + all: unset; + background-color: transparent; - &:hover label { - background-color: color.adjust($fg, $alpha: -0.84); - border-color: color.adjust($accent, $alpha: -0.8); + &:hover label { + background-color: color.adjust($fg, $alpha: -0.84); + border-color: color.adjust($accent, $alpha: -0.8); + } + + &:active label { + background-color: color.adjust($fg, $alpha: -0.8) + } } - &:active label { - background-color: color.adjust($fg, $alpha: -0.8) + label { + transition: 200ms; + padding: 0 8px; + margin: 2px; + border-radius: $radius; + border: 1pt solid transparent; } - } - label { - transition: 200ms; - padding: 0 8px; - margin: 2px; - border-radius: $radius; - border: 1pt solid transparent; + .focused label { + color: $accent; + border-color: $accent; + } } - .Workspaces .focused label { - color: $accent; - border-color: $accent; + .SysTray { + margin-right: 8px; + + button { + padding: 0 4px; + } } .FocusedClient { diff --git a/examples/js/simple-bar/widget/Bar.tsx b/examples/js/simple-bar/widget/Bar.tsx index f5e96cb..87cc20d 100644 --- a/examples/js/simple-bar/widget/Bar.tsx +++ b/examples/js/simple-bar/widget/Bar.tsx @@ -11,17 +11,16 @@ import Tray from "gi://AstalTray" function SysTray() { const tray = Tray.get_default() - return - {bind(tray, "items").as(items => items.map(item => { - - return + {bind(tray, "items").as(items => items.map(item => ( + { return { prefix: "dbusmenu", actionGroup: ag}})} - menuModel={bind(item, "menu-model")} > + actionGroup={bind(item, "action-group").as(ag => ["dbusmenu", ag])} + menuModel={bind(item, "menu-model")}> - }))} + ))} } -- cgit v1.2.3 From d16c856074531b9fb867b8922be370bcfc749614 Mon Sep 17 00:00:00 2001 From: rRedLim <82714753+rRedLim@users.noreply.github.com> Date: Fri, 20 Dec 2024 02:21:09 +0300 Subject: chore: simple-bar filter special workspaces (#168) --- examples/js/simple-bar/widget/Bar.tsx | 1 + 1 file changed, 1 insertion(+) (limited to 'examples/js') diff --git a/examples/js/simple-bar/widget/Bar.tsx b/examples/js/simple-bar/widget/Bar.tsx index 87cc20d..54a14b0 100644 --- a/examples/js/simple-bar/widget/Bar.tsx +++ b/examples/js/simple-bar/widget/Bar.tsx @@ -89,6 +89,7 @@ function Workspaces() { return {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 => (