From 5bde26496e0394cd7267966adb08e56c304bc24e Mon Sep 17 00:00:00 2001 From: Evertiro Date: Sun, 8 Mar 2026 04:33:31 -0500 Subject: bar: allow hiding tray icons (#1227) * First pass at hiding systray icons Signed-off-by: Dan Griffiths * Don't dump all IDs for no reason >_< Signed-off-by: Dan Griffiths * Better handling for hiding tray icons Signed-off-by: Dan Griffiths * Re-add EOF newline Signed-off-by: Dan Griffiths * Hide popouts too Signed-off-by: Dan Griffiths * Hide the expand icon if no icons are visible Signed-off-by: Dan Griffiths * Update modules/bar/components/Tray.qml Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> * Update modules/bar/components/Tray.qml Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> * Update modules/bar/components/Tray.qml Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> * That needs to be inverted * Clean up Signed-off-by: Dan Griffiths * fix --------- Signed-off-by: Dan Griffiths Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> --- modules/bar/components/Tray.qml | 7 +++++-- modules/bar/popouts/Content.qml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/bar/components/Tray.qml b/modules/bar/components/Tray.qml index 96956f6..7bafda1 100644 --- a/modules/bar/components/Tray.qml +++ b/modules/bar/components/Tray.qml @@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound import qs.components import qs.services import qs.config +import Quickshell import Quickshell.Services.SystemTray import QtQuick @@ -66,7 +67,9 @@ StyledRect { Repeater { id: items - model: SystemTray.items + model: ScriptModel { + values: SystemTray.items.values.filter(i => !Config.bar.tray.hiddenIcons.includes(i.id)) + } TrayItem {} } @@ -82,7 +85,7 @@ StyledRect { anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom - active: Config.bar.tray.compact + active: Config.bar.tray.compact && items.count > 0 sourceComponent: Item { implicitWidth: expandIconInner.implicitWidth diff --git a/modules/bar/popouts/Content.qml b/modules/bar/popouts/Content.qml index 4076844..6543e58 100644 --- a/modules/bar/popouts/Content.qml +++ b/modules/bar/popouts/Content.qml @@ -128,7 +128,7 @@ Item { Repeater { model: ScriptModel { - values: [...SystemTray.items.values] + values: SystemTray.items.values.filter(i => !Config.bar.tray.hiddenIcons.includes(i.id)) } Popout { -- cgit v1.2.3-freya