Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2009-06-06 14:26:02 (GMT)
committer Tomeu Vizoso <tomeu@sugarlabs.org>2009-06-06 14:26:02 (GMT)
commita17fcb280ee81d49d25da3779653962e316b84f6 (patch)
tree3c80a6a774094cb0d8386e4a67e809fa80247f27
parent4361f271c62326a04394de874b54b616d8b596e3 (diff)
Add toggling support to the favorite icon
-rw-r--r--src/jarabe/desktop/activitieslist.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/jarabe/desktop/activitieslist.py b/src/jarabe/desktop/activitieslist.py
index 88a1478..3946dcc 100644
--- a/src/jarabe/desktop/activitieslist.py
+++ b/src/jarabe/desktop/activitieslist.py
@@ -54,6 +54,8 @@ class ActivitiesTreeView(gtk.TreeView):
cell_icon.props.height = style.GRID_CELL_SIZE
cell_icon.props.size = style.SMALL_ICON_SIZE
cell_icon.props.icon_name = 'emblem-favorite'
+ cell_icon.props.mode = gtk.CELL_RENDERER_MODE_ACTIVATABLE
+ cell_icon.connect('activate', self.__favorite_activate_cb)
column = gtk.TreeViewColumn('')
column.pack_start(cell_icon)
@@ -174,6 +176,9 @@ class ActivitiesTreeView(gtk.TreeView):
cell.props.stroke_color = style.COLOR_BUTTON_GREY.get_svg()
cell.props.fill_color = style.COLOR_WHITE.get_svg()
+ def __favorite_activate_cb(self, cell, path):
+ self.get_model()[path][0] = not self.get_model()[path][0]
+
class ActivitiesList(gtk.VBox):
__gtype_name__ = 'SugarActivitiesList'