From 331a33be74d3bab172d864a46c5d72b7da7fcd0c Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Wed, 26 Feb 2025 18:14:27 +0100 Subject: [PATCH] Fixed an issue where the battery percentage text was sometimes shown when it shouldn't have been --- es-core/src/components/SystemStatusComponent.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/es-core/src/components/SystemStatusComponent.cpp b/es-core/src/components/SystemStatusComponent.cpp index 649f0b206..77df818f5 100644 --- a/es-core/src/components/SystemStatusComponent.cpp +++ b/es-core/src/components/SystemStatusComponent.cpp @@ -120,7 +120,9 @@ void SystemStatusComponent::updateGrid() } } - if (mHasBattery && mBatteryText) { + if (mHasBattery && mBatteryText && + std::find(mDisplayEntries.cbegin(), mDisplayEntries.cend(), "battery") != + mDisplayEntries.cend()) { // We set the initial value to "100%" to calculate the cell size based on this, as this // will be the longest text that will ever be displayed for the battery capacity. mBatteryPercentage = std::make_shared(