Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-03-29 19:00:27 (GMT)
committer Dan Williams <dcbw@redhat.com>2007-03-29 19:00:27 (GMT)
commit40f4c81d061aa6d81af9589864228a35d2c110fd (patch)
tree22ac4cc818e774a38d9d2815d451204fcf6c980f /shell
parentd5826d19347f44aaafa37dbc9afcae3a8888c951 (diff)
Make the mesh icon pulse when activated and activating
Diffstat (limited to 'shell')
-rw-r--r--shell/view/home/MeshBox.py40
1 files changed, 29 insertions, 11 deletions
diff --git a/shell/view/home/MeshBox.py b/shell/view/home/MeshBox.py
index 6e02edf..088d8f7 100644
--- a/shell/view/home/MeshBox.py
+++ b/shell/view/home/MeshBox.py
@@ -111,13 +111,20 @@ class AccessPointView(PulsingIcon):
color.HTMLColor(self._device_fill) ]
]
-class MeshDeviceView(CanvasIcon):
+
+_MESH_ICON_NAME = 'theme:device-network-mesh'
+
+class MeshDeviceView(PulsingIcon):
def __init__(self, nm_device):
- CanvasIcon.__init__(self, scale=units.MEDIUM_ICON_SCALE,
- icon_name='theme:device-network-mesh')
+ PulsingIcon.__init__(self, scale=units.MEDIUM_ICON_SCALE,
+ icon_name=_MESH_ICON_NAME)
self._nm_device = nm_device
self.props.tooltip = _("Mesh Network")
+ mycolor = profile.get_color()
+ self._device_fill = mycolor.get_fill_color()
+ self._device_stroke = mycolor.get_stroke_color()
+
self.connect('activated', self._activate_cb)
self._nm_device.connect('state-changed', self._state_changed_cb)
@@ -131,18 +138,29 @@ class MeshDeviceView(CanvasIcon):
self._update_state()
def _update_state(self):
- # FIXME Change icon colors once we have real icons
state = self._nm_device.get_state()
if state == nmclient.DEVICE_STATE_ACTIVATING:
- self.props.fill_color = color.ICON_FILL_INACTIVE
- self.props.stroke_color = color.ICON_STROKE_INACTIVE
+ self.props.pulse_time = 0.75
+ self.props.colors = [
+ [ color.HTMLColor(self._device_stroke),
+ color.HTMLColor(self._device_fill) ],
+ [ color.HTMLColor(self._device_stroke),
+ color.HTMLColor('#e2e2e2') ]
+ ]
elif state == nmclient.DEVICE_STATE_ACTIVATED:
- mycolor = profile.get_color()
- self.props.fill_color = color.HTMLColor(mycolor.get_fill_color())
- self.props.stroke_color = color.HTMLColor(mycolor.get_stroke_color())
+ self.props.pulse_time = 1.5
+ self.props.colors = [
+ [ color.HTMLColor(self._device_stroke),
+ color.HTMLColor(self._device_fill) ],
+ [ color.HTMLColor('#ffffff'),
+ color.HTMLColor(self._device_fill) ]
+ ]
elif state == nmclient.DEVICE_STATE_INACTIVE:
- self.props.fill_color = color.ICON_FILL_INACTIVE
- self.props.stroke_color = color.ICON_STROKE_INACTIVE
+ self.props.pulse_time = 0.0
+ self.props.colors = [
+ [ color.HTMLColor(self._device_stroke),
+ color.HTMLColor(self._device_fill) ]
+ ]
class ActivityView(SnowflakeBox):
def __init__(self, shell, menu_shell, model):