Use badge-charging on battery icon when charging. #722

This commit is contained in:
Dan Winship 2007-08-24 09:07:28 -04:00
parent 1f129e6136
commit 60cd7111c0
2 changed files with 4 additions and 0 deletions

1
NEWS
View File

@ -1,3 +1,4 @@
* #722 Show "charging" badge on battery. (danw)
* #2010 Remember state when scrubbing. (marco) * #2010 Remember state when scrubbing. (marco)
Snapshot d38cacfe2c Snapshot d38cacfe2c

View File

@ -46,10 +46,13 @@ class DeviceView(canvasicon.CanvasIcon):
# Update palette # Update palette
if self._model.props.charging: if self._model.props.charging:
status = _STATUS_CHARGING status = _STATUS_CHARGING
self.props.badge_name = 'theme:badge-charging'
elif self._model.props.discharging: elif self._model.props.discharging:
status = _STATUS_DISCHARGING status = _STATUS_DISCHARGING
self.props.badge_name = None
else: else:
status = _STATUS_FULLY_CHARGED status = _STATUS_FULLY_CHARGED
self.props.badge_name = None
self._palette.set_level(self._model.props.level) self._palette.set_level(self._model.props.level)
self._palette.set_status(status) self._palette.set_status(status)