data: fix icon theme for battery level

It was previously assigning levels 1-89 to caution and 90+ to full, which was unintended due to the floor division by 100
This commit is contained in:
Zachary Cook 2019-08-20 03:35:31 -04:00 committed by Filipe Laíns
parent a868b477e1
commit a06ea6de11
1 changed files with 3 additions and 3 deletions

View File

@ -133,9 +133,9 @@ def _battery_icon_name(level, charging):
level_approx = 20 * ((level + 10) // 20) level_approx = 20 * ((level + 10) // 20)
if _has_mint_icons: if _has_mint_icons:
if level == 0: if level == 100 and charging:
return 'battery-empty%s-symbolic' % ('-charging' if charging else '') return 'battery-full-charged-symbolic'
level_name = ('caution', 'low', 'good', 'full')[3*(level_approx // 100)] level_name = ('empty', 'caution', 'low', 'good', 'good', 'full')[level_approx // 20]
return 'battery-%s%s-symbolic' % (level_name, '-charging' if charging else '') return 'battery-%s%s-symbolic' % (level_name, '-charging' if charging else '')
if _has_gpm_icons: if _has_gpm_icons: