From c1bfd8c0b7be65be978928e89f4f28b09778ff2c Mon Sep 17 00:00:00 2001 From: bbedward Date: Wed, 18 Feb 2026 18:31:33 -0500 Subject: [PATCH] system tray: fix to take up 0 space when empty --- .../Modules/DankBar/Widgets/SystemTrayBar.qml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/quickshell/Modules/DankBar/Widgets/SystemTrayBar.qml b/quickshell/Modules/DankBar/Widgets/SystemTrayBar.qml index 48b0852d..df1c57b0 100644 --- a/quickshell/Modules/DankBar/Widgets/SystemTrayBar.qml +++ b/quickshell/Modules/DankBar/Widgets/SystemTrayBar.qml @@ -99,6 +99,44 @@ BasePill { property bool suppressShiftAnimation: false readonly property bool hasHiddenItems: allTrayItems.length > mainBarItems.length visible: allTrayItems.length > 0 + opacity: allTrayItems.length > 0 ? 1 : 0 + + states: [ + State { + name: "hidden_horizontal" + when: allTrayItems.length === 0 && !isVerticalOrientation + PropertyChanges { + target: root + width: 0 + } + }, + State { + name: "hidden_vertical" + when: allTrayItems.length === 0 && isVerticalOrientation + PropertyChanges { + target: root + height: 0 + } + } + ] + + transitions: [ + Transition { + NumberAnimation { + properties: "width,height" + duration: Theme.shortDuration + easing.type: Theme.standardEasing + } + } + ] + + Behavior on opacity { + NumberAnimation { + duration: Theme.shortDuration + easing.type: Theme.standardEasing + } + } + readonly property real trayItemSize: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground) + 6 readonly property real minTooltipY: {