Use xo color for mesh and battery devices.
This commit is contained in:
parent
14d51cc381
commit
42d0085b0b
@ -14,9 +14,11 @@
|
|||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
from gettext import gettext as _
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from gettext import gettext as _
|
from sugar import profile
|
||||||
from sugar.graphics.icon import CanvasIcon
|
from sugar.graphics.icon import CanvasIcon
|
||||||
from sugar.graphics.icon import get_icon_state
|
from sugar.graphics.icon import get_icon_state
|
||||||
from sugar.graphics import style
|
from sugar.graphics import style
|
||||||
@ -30,7 +32,8 @@ _STATUS_FULLY_CHARGED = 2
|
|||||||
|
|
||||||
class DeviceView(CanvasIcon):
|
class DeviceView(CanvasIcon):
|
||||||
def __init__(self, model):
|
def __init__(self, model):
|
||||||
CanvasIcon.__init__(self, size=style.MEDIUM_ICON_SIZE)
|
CanvasIcon.__init__(self, size=style.MEDIUM_ICON_SIZE,
|
||||||
|
xo_color=profile.get_color())
|
||||||
self._model = model
|
self._model = model
|
||||||
self._palette = BatteryPalette(_('My Battery life'))
|
self._palette = BatteryPalette(_('My Battery life'))
|
||||||
self.set_palette(self._palette)
|
self.set_palette(self._palette)
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
from sugar import profile
|
||||||
from sugar.graphics import canvasicon
|
from sugar.graphics import canvasicon
|
||||||
from sugar.graphics import style
|
from sugar.graphics import style
|
||||||
from model.devices import device
|
from model.devices import device
|
||||||
@ -38,8 +39,7 @@ class DeviceView(canvasicon.CanvasIcon):
|
|||||||
self.props.fill_color = style.COLOR_INACTIVE_FILL.get_svg()
|
self.props.fill_color = style.COLOR_INACTIVE_FILL.get_svg()
|
||||||
self.props.stroke_color = style.COLOR_INACTIVE_STROKE.get_svg()
|
self.props.stroke_color = style.COLOR_INACTIVE_STROKE.get_svg()
|
||||||
elif state == device.STATE_ACTIVATED:
|
elif state == device.STATE_ACTIVATED:
|
||||||
self.props.fill_color = None
|
self.props.xo_color = profile.get_color()
|
||||||
self.props.stroke_color = None
|
|
||||||
elif state == device.STATE_INACTIVE:
|
elif state == device.STATE_INACTIVE:
|
||||||
self.props.fill_color = style.COLOR_INACTIVE_FILL.get_svg()
|
self.props.fill_color = style.COLOR_INACTIVE_FILL.get_svg()
|
||||||
self.props.stroke_color = style.COLOR_INACTIVE_STROKE.get_svg()
|
self.props.stroke_color = style.COLOR_INACTIVE_STROKE.get_svg()
|
||||||
|
Loading…
Reference in New Issue
Block a user