Skip to content

Commit

Permalink
cs_power.py: Use symbolic icons for battery status.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtwebster committed Aug 9, 2018
1 parent 91302ec commit ef1cf5d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions files/usr/share/cinnamon/cinnamon-settings/modules/cs_power.py
Expand Up @@ -490,7 +490,7 @@ def create_battery_row(self, device_id, icon_name, desc, percentage, battery_lev
hbox.pack_start(level_box, True, True, 0)
else:
status_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
status_icon = Gtk.Image.new_from_icon_name(self.bat_level_to_icon(battery_level), Gtk.IconSize.DND)
status_icon = Gtk.Image.new_from_icon_name(self.bat_level_to_icon(battery_level), Gtk.IconSize.BUTTON)
status_box.pack_start(status_icon, False, False, 15)

status_label = Gtk.Label(self.bat_level_to_label(battery_level))
Expand All @@ -511,13 +511,13 @@ def create_battery_row(self, device_id, icon_name, desc, percentage, battery_lev

def bat_level_to_icon(self, level):
if level in (UPowerGlib.DeviceLevel.FULL, UPowerGlib.DeviceLevel.HIGH):
return "battery-full"
return "battery-full-symbolic"
elif level == UPowerGlib.DeviceLevel.NORMAL:
return "battery-good"
return "battery-good-symbolic"
elif level == UPowerGlib.DeviceLevel.LOW:
return "battery-low"
return "battery-low-symbolic"
elif level == UPowerGlib.DeviceLevel.CRITICAL:
return "battery-caution"
return "battery-caution-symbolic"

def bat_level_to_label(self, level):
if level == UPowerGlib.DeviceLevel.FULL:
Expand Down

0 comments on commit ef1cf5d

Please sign in to comment.