From a25cdb43d58e28bdf55990ca869cfe309c5ed97e Mon Sep 17 00:00:00 2001 From: bbedward Date: Thu, 15 Jan 2026 23:00:19 -0500 Subject: [PATCH] controlcenter: fix visibility condition of no icons fixes #1377 --- .../DankBar/Widgets/ControlCenterButton.qml | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/quickshell/Modules/DankBar/Widgets/ControlCenterButton.qml b/quickshell/Modules/DankBar/Widgets/ControlCenterButton.qml index a768079c..f9876264 100644 --- a/quickshell/Modules/DankBar/Widgets/ControlCenterButton.qml +++ b/quickshell/Modules/DankBar/Widgets/ControlCenterButton.qml @@ -24,6 +24,7 @@ BasePill { property bool showMicPercent: widgetData?.showMicPercent !== undefined ? widgetData.showMicPercent : SettingsData.controlCenterShowMicPercent property bool showBatteryIcon: widgetData?.showBatteryIcon !== undefined ? widgetData.showBatteryIcon : SettingsData.controlCenterShowBatteryIcon property bool showPrinterIcon: widgetData?.showPrinterIcon !== undefined ? widgetData.showPrinterIcon : SettingsData.controlCenterShowPrinterIcon + property bool showScreenSharingIcon: widgetData?.showScreenSharingIcon !== undefined ? widgetData.showScreenSharingIcon : SettingsData.controlCenterShowScreenSharingIcon property real touchpadThreshold: 100 property real micAccumulator: 0 property real volumeAccumulator: 0 @@ -213,7 +214,25 @@ BasePill { } function hasNoVisibleIcons() { - return !root.showNetworkIcon && !root.showBluetoothIcon && !root.showAudioIcon && !root.showVpnIcon && !root.showBrightnessIcon && !root.showMicIcon && !root.showBatteryIcon && !root.showPrinterIcon; + if (root.showScreenSharingIcon && NiriService.hasCasts) + return false; + if (root.showNetworkIcon && NetworkService.networkAvailable) + return false; + if (root.showVpnIcon && NetworkService.vpnAvailable && NetworkService.vpnConnected) + return false; + if (root.showBluetoothIcon && BluetoothService.available && BluetoothService.enabled) + return false; + if (root.showAudioIcon) + return false; + if (root.showMicIcon) + return false; + if (root.showBrightnessIcon && DisplayService.brightnessAvailable && root.hasPinnedBrightnessDevice()) + return false; + if (root.showBatteryIcon && BatteryService.batteryAvailable) + return false; + if (root.showPrinterIcon && CupsService.cupsAvailable && root.hasPrintJobs()) + return false; + return true; } content: Component { @@ -227,6 +246,14 @@ BasePill { anchors.centerIn: parent spacing: Theme.spacingXS + DankIcon { + name: "screen_record" + size: Theme.barIconSize(root.barThickness, -4) + color: NiriService.hasActiveCast ? Theme.primary : Theme.surfaceText + anchors.horizontalCenter: parent.horizontalCenter + visible: root.showScreenSharingIcon && NiriService.hasCasts + } + DankIcon { name: root.getNetworkIconName() size: Theme.barIconSize(root.barThickness, -4) @@ -402,6 +429,14 @@ BasePill { anchors.centerIn: parent spacing: Theme.spacingXS + DankIcon { + name: "screen_record" + size: Theme.barIconSize(root.barThickness, -4) + color: NiriService.hasActiveCast ? Theme.primary : Theme.surfaceText + anchors.verticalCenter: parent.verticalCenter + visible: root.showScreenSharingIcon && NiriService.hasCasts + } + DankIcon { id: networkIcon name: root.getNetworkIconName()