From 404d5362e58d29ad3dcab6d7d15617a06b62e394 Mon Sep 17 00:00:00 2001 From: Vaibhav Pratap Singh Date: Thu, 22 Oct 2026 21:43:48 +0530 Subject: [PATCH] battery: pulse only the icon when the bar has no background (#3861) (cherry picked from commit 0aab0ec09b59d07f5238bcb8a735b1fab0391581) --- quickshell/Modules/DBar/Widgets/Battery.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quickshell/Modules/DBar/Widgets/Battery.qml b/quickshell/Modules/DBar/Widgets/Battery.qml index 6bf639eb9..b23556f77 100644 --- a/quickshell/Modules/DBar/Widgets/Battery.qml +++ b/quickshell/Modules/DBar/Widgets/Battery.qml @@ -30,10 +30,10 @@ BasePill { readonly property bool showPower: BatteryService.isCharging ? showPowerCharging : showPowerDischarging readonly property bool critical: SettingsData.batteryCriticalAnimation && BatteryService.isCriticalBattery && !BatteryService.isCharging property real criticalPulse: 0 - readonly property color criticalForeground: battery.mixColor(Theme.error, Theme.surface, criticalPulse) + readonly property color criticalForeground: noBackground ? battery.mixColor(Theme.error, defaultContentColor, criticalPulse) : battery.mixColor(Theme.error, Theme.surface, criticalPulse) - fillColor: critical ? battery.mixColor(defaultFillColor, Theme.error, criticalPulse) : defaultFillColor - contentColor: critical ? battery.mixColor(defaultContentColor, Theme.surface, criticalPulse) : defaultContentColor + fillColor: critical && !noBackground ? battery.mixColor(defaultFillColor, Theme.error, criticalPulse) : defaultFillColor + contentColor: critical ? (noBackground ? criticalForeground : battery.mixColor(defaultContentColor, Theme.surface, criticalPulse)) : defaultContentColor function mixColor(from, to, progress) { return Qt.rgba(from.r + (to.r - from.r) * progress, from.g + (to.g - from.g) * progress, from.b + (to.b - from.b) * progress, from.a + (to.a - from.a) * progress);