diff options
Diffstat (limited to 'apps/gui/statusbar.c')
-rw-r--r-- | apps/gui/statusbar.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index 84de16987f..30dad95509 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c | |||
@@ -427,9 +427,10 @@ static void gui_statusbar_icon_battery(struct screen * display, int percent, | |||
427 | /* show graphical animation when charging instead of numbers */ | 427 | /* show graphical animation when charging instead of numbers */ |
428 | if ((global_settings.battery_display) && | 428 | if ((global_settings.battery_display) && |
429 | (charge_state != CHARGING) && | 429 | (charge_state != CHARGING) && |
430 | (percent > -1)) { | 430 | (percent > -1) && |
431 | (percent <= 100)) { | ||
431 | #else /* all others */ | 432 | #else /* all others */ |
432 | if (global_settings.battery_display && (percent > -1)) { | 433 | if (global_settings.battery_display && (percent > -1) && (percent <= 100)) { |
433 | #endif | 434 | #endif |
434 | /* Numeric display */ | 435 | /* Numeric display */ |
435 | display->setfont(FONT_SYSFIXED); | 436 | display->setfont(FONT_SYSFIXED); |
@@ -465,7 +466,7 @@ static void gui_statusbar_icon_battery(struct screen * display, int percent, | |||
465 | #endif | 466 | #endif |
466 | } | 467 | } |
467 | 468 | ||
468 | if (percent == -1) { | 469 | if (percent == -1 || percent > 100) { |
469 | display->setfont(FONT_SYSFIXED); | 470 | display->setfont(FONT_SYSFIXED); |
470 | display->putsxy(STATUSBAR_BATTERY_X_POS + STATUSBAR_BATTERY_WIDTH / 2 | 471 | display->putsxy(STATUSBAR_BATTERY_X_POS + STATUSBAR_BATTERY_WIDTH / 2 |
471 | - 4, STATUSBAR_Y_POS, "?"); | 472 | - 4, STATUSBAR_Y_POS, "?"); |