Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/activity.py
diff options
context:
space:
mode:
authorDaniel Francis <francis@sugarlabs.org>2012-07-04 21:13:05 (GMT)
committer Daniel Francis <francis@sugarlabs.org>2012-07-04 21:13:05 (GMT)
commit68b0e4bb66d6a1e68fb747bf2d3ba97380a00aba (patch)
treeb74b031b7adc95d0055934998d1ad88d3cea2e27 /activity.py
parent7336d7ad061282a84abfb25c92533086df128b42 (diff)
Update line color when the function selection is updated
Diffstat (limited to 'activity.py')
-rw-r--r--activity.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/activity.py b/activity.py
index 84e6a1f..3ce35eb 100644
--- a/activity.py
+++ b/activity.py
@@ -790,10 +790,10 @@ Toggle between a graph that connects points with lines and one that does not
remove_function.connect('clicked', self._remove_function)
remove_function.show()
self.toolbar_box.toolbar.insert(remove_function, -1)
- line_color_btn = ColorToolButton()
- line_color_btn.set_title(_("Function color"))
- line_color_btn.show_all()
- self.toolbar_box.toolbar.insert(line_color_btn, -1)
+ self.line_color_btn = ColorToolButton()
+ self.line_color_btn.set_title(_("Function color"))
+ self.line_color_btn.show_all()
+ self.toolbar_box.toolbar.insert(self.line_color_btn, -1)
separator = gtk.SeparatorToolItem()
separator.set_draw(False)
separator.set_expand(True)
@@ -813,6 +813,8 @@ Toggle between a graph that connects points with lines and one that does not
self.functions_list = FunctionsList()
self.functions_list.connect('list-updated',
self.update_graph)
+ self.functions_list.connect('function-selected',
+ self._update_color_selection)
self.functions_list.append_function(gtk.gdk.color_parse(
self.profile_color.get_fill_color()))
self.functions_list.show()
@@ -835,6 +837,9 @@ Toggle between a graph that connects points with lines and one that does not
self.v_box.pack_end(self.status_bar, False, True, 0)
self.v_box.show_all()
+ def _update_color_selection(self, widget, color):
+ self.line_color_btn.set_color(color)
+
def _remove_function(self, widget):
self.functions_list.remove_function()
self.update_graph(None, self.functions_list.get_list())