diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..f195485 --- /dev/null +++ b/TODO.md @@ -0,0 +1,7 @@ +# Todo + +- [x] Fix charging state always in "charging" +- [ ] Review or fix parsing of the battery, wifi, ... info +- [ ] Dynamic battery icon +- [ ] Fix QTWebEngine lags +- [ ] Fix layout overflow/ weird behaviour diff --git a/src/shell/taskbar/platform/battery_controller.cpp b/src/shell/taskbar/platform/battery_controller.cpp index 884e6c6..f4e39a2 100644 --- a/src/shell/taskbar/platform/battery_controller.cpp +++ b/src/shell/taskbar/platform/battery_controller.cpp @@ -38,7 +38,8 @@ void BatteryController::refresh() next.percentage = match.captured(1).toInt(); } } else if (trimmed.startsWith(QStringLiteral("state:"))) { - next.charging = trimmed.contains(QStringLiteral("charging")); + next.charging = !trimmed.contains(QStringLiteral("discharging")); + // When not charging, it displays discharging, which contains charging, therefore it would always show charging status as charging. This fixes that issue by doing the reverse. } else if (trimmed.startsWith(QStringLiteral("time to empty:")) || trimmed.startsWith(QStringLiteral("time to full:"))) { next.timeRemaining = trimmed.section(':', 1).trimmed(); }