Skip to content

Commit

Permalink
Merge pull request #2228 from rrrapha/battery-backport
Browse files Browse the repository at this point in the history
 Fix battery widget percentage display for 2.2
  • Loading branch information
uklotzde authored Aug 7, 2019
2 parents 4d87e3a + ab59a23 commit 9487467
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/widget/wbattery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ QString formatMinutes(int minutes) {

int pixmapIndexFromPercentage(double dPercentage, int numPixmaps) {
// See WDisplay::getActivePixmapIndex for more info on this.
int result = static_cast<int>(dPercentage * numPixmaps - 0.00001);
int result = static_cast<int>(dPercentage / 100.0 * numPixmaps);
result = math_min(numPixmaps - 1, math_max(0, result));
return result;
}
Expand Down

0 comments on commit 9487467

Please sign in to comment.