Update BatteryIcon.cpp

Improvement to the mapping of battery percentage to the battery icon to be displayed.
This commit is contained in:
hassless 2021-06-09 13:47:22 +02:00 committed by GitHub
parent 79f0fcb07a
commit d0df278b0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,13 +4,13 @@
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;
const char* BatteryIcon::GetBatteryIcon(int batteryPercent) { const char* BatteryIcon::GetBatteryIcon(int batteryPercent) {
if (batteryPercent > 90) if (batteryPercent > 87)
return Symbols::batteryFull; return Symbols::batteryFull;
if (batteryPercent > 75) if (batteryPercent > 62)
return Symbols::batteryThreeQuarter; return Symbols::batteryThreeQuarter;
if (batteryPercent > 50) if (batteryPercent > 37)
return Symbols::batteryHalf; return Symbols::batteryHalf;
if (batteryPercent > 25) if (batteryPercent > 12)
return Symbols::batteryOneQuarter; return Symbols::batteryOneQuarter;
return Symbols::batteryEmpty; return Symbols::batteryEmpty;
} }