Comment 4 for bug 1388235

Revision history for this message
Charles Kerr (charlesk) wrote : Re: Battery icon turns red at 30%

So, what the spec says is:

> * The charge level should be visually supported through the different states of the battery indicator icon (i.e. 20%, 40%, 60%, 80%,100% & battery charged) in the status bar.
> * When the phone drops below 20% power, the battery indicator should turn red giving a nudge to recharge.

I-power currently picks the closest match of the -000, -020, -040, -060, -080, and -100 icons; e.g. a charge of 51% will get the -060 icon, and a charge of 49% will get the -040 icon. This is /usually/ The Right Thing because it minimizes the difference between the icon level and the actual battery level.

However this does mean 29% shows red. So we need a special case to treat the 20-30% range as a special case that deviates from the "closest match" approach, such as:

[0%..10%) battery-000
[10%..20%) battery-020
[20%...50%) battery-040
[50%..70%) battery-060
[70%..90%) battery-080
[90%..100%] battery-100

This works but isn't a great fix because the icon-to-label shear can be up to 20%: if the battery is at 20%, the label will read 20% and the icon will show 40%.

We also can't just change the 20% icon to black because we also want to maintain compatibility with other in-house and third-party icon themes on Desktop.

IMO we should do the closest match / special case approach listed above but ALSO add new charging/discharging icons for battery-010, -030, -050, -070, and -090. i-power would generally match to the nearest 10% icon, add a special case for [20-25%], and use the existing GNOME icon names as fallbacks.fallbacks.

This approach would:

(a) Fix this bug

(b) Not regress on icon-to-label shear. (Currently the max is 10%, under this scheme the worst case would be a battery at 20% and an icon at -030) and in the general case it would /reduce/ the shear since we'd be matching to the closest 10% instead of closest 20%.

(c) Maintain compatibility with other desktop icon themes by using the current names as fallbacks