Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-11-09 17:18:36 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-11-09 17:18:36 (GMT)
commitb3fa0c001cfcff3e1f9fc5debf4cb267b87776f6 (patch)
treeb8a18d0c87900d5cf6419baa4ea073109b988870 /shell
parent2d8c53bbef64cb255501425931fa8876ebcfdc45 (diff)
#4728, #4764: Set the correct colors for filtered out mesh view icons.
Diffstat (limited to 'shell')
-rw-r--r--shell/view/BuddyIcon.py4
-rw-r--r--shell/view/home/MeshBox.py37
2 files changed, 26 insertions, 15 deletions
diff --git a/shell/view/BuddyIcon.py b/shell/view/BuddyIcon.py
index a56a1c5..3734001 100644
--- a/shell/view/BuddyIcon.py
+++ b/shell/view/BuddyIcon.py
@@ -42,8 +42,8 @@ class BuddyIcon(CanvasIcon):
def _update_color(self):
if self._greyed_out:
- self.props.stroke_color = style.COLOR_INACTIVE_STROKE.get_svg()
- self.props.fill_color = style.COLOR_INACTIVE_FILL.get_svg()
+ self.props.stroke_color = '#D5D5D5'
+ self.props.fill_color = '#E5E5E5'
else:
self.props.xo_color = self._buddy.get_color()
diff --git a/shell/view/home/MeshBox.py b/shell/view/home/MeshBox.py
index 3943973..f475bb6 100644
--- a/shell/view/home/MeshBox.py
+++ b/shell/view/home/MeshBox.py
@@ -148,17 +148,14 @@ class AccessPointView(PulsingIcon):
if self._disconnect_item:
self._disconnect_item.hide()
self.props.pulse_time = 0.0
+ self.props.colors = [
+ [ style.Color(self._device_stroke).get_svg(),
+ style.Color(self._device_fill).get_svg() ]
+ ]
- if self._greyed_out:
- self.props.colors = [
- [ style.COLOR_INACTIVE_STROKE.get_svg(),
- style.COLOR_INACTIVE_FILL.get_svg() ]
- ]
- else:
- self.props.colors = [
- [ style.Color(self._device_stroke).get_svg(),
- style.Color(self._device_fill).get_svg() ]
- ]
+ if self._greyed_out:
+ self.props.pulse_time = 0.0
+ self.props.colors = [['#D5D5D5', '#D5D5D5']]
def set_filter(self, query):
self._greyed_out = self._model.props.name.lower().find(query) == -1
@@ -177,6 +174,7 @@ class MeshDeviceView(PulsingIcon):
self._nm_device = nm_device
self.channel = channel
self.props.badge_name = "badge-channel-%d" % self.channel
+ self._greyed_out = False
self._disconnect_item = None
self._palette = self._create_palette()
@@ -222,7 +220,9 @@ class MeshDeviceView(PulsingIcon):
def _update_state(self):
state = self._nm_device.get_state()
chan = wireless.freq_to_channel(self._nm_device.get_frequency())
- if state == nmclient.DEVICE_STATE_ACTIVATING and chan == self.channel:
+ if self._greyed_out:
+ self.props.colors = [['#D5D5D5', '#D5D5D5']]
+ elif state == nmclient.DEVICE_STATE_ACTIVATING and chan == self.channel:
self._disconnect_item.hide()
self.props.pulse_time = 0.75
self.props.colors = [
@@ -250,6 +250,10 @@ class MeshDeviceView(PulsingIcon):
else:
raise RuntimeError("Shouldn't get here")
+ def set_filter(self, query):
+ self._greyed_out = (query != '')
+ self._update_state()
+
class ActivityView(hippo.CanvasBox):
def __init__(self, shell, model):
hippo.CanvasBox.__init__(self)
@@ -293,11 +297,15 @@ class ActivityView(hippo.CanvasBox):
text_to_check = self._model.activity.props.name.lower() + \
self._model.activity.props.type.lower()
if text_to_check.find(query) == -1:
- self._icon.props.stroke_color = style.COLOR_INACTIVE_STROKE.get_svg()
- self._icon.props.fill_color = style.COLOR_INACTIVE_FILL.get_svg()
+ self._icon.props.stroke_color = '#D5D5D5'
+ self._icon.props.fill_color = '#E5E5E5'
else:
self._icon.props.xo_color = self._model.get_color()
+ for key, icon in self._icons.iteritems():
+ if hasattr(icon, 'set_filter'):
+ icon.set_filter(query)
+
_AUTOSEARCH_TIMEOUT = 1000
class MeshToolbar(gtk.Toolbar):
@@ -505,6 +513,9 @@ class MeshBox(hippo.CanvasBox):
style.SMALL_ICON_SIZE)
activity.add_buddy_icon(buddy_model.get_key(), icon)
+ if hasattr(icon, 'set_filter'):
+ icon.set_filter(self._query)
+
def _add_activity(self, activity_model):
icon = ActivityView(self._shell, activity_model)
self._layout.add(icon)