[hamster-applet/gnome-2-32] make sure the colors are defined - fixes bug 628824



commit c3151af494c18e3aab3ea74de5c1a3812ffba645
Author: Toms Bauģis <toms baugis gmail com>
Date:   Mon Sep 6 01:28:50 2010 +0100

    make sure the colors are defined - fixes bug 628824

 src/hamster/widgets/facttree.py |   20 ++++++--------------
 1 files changed, 6 insertions(+), 14 deletions(-)
---
diff --git a/src/hamster/widgets/facttree.py b/src/hamster/widgets/facttree.py
index dabd969..ec9a952 100644
--- a/src/hamster/widgets/facttree.py
+++ b/src/hamster/widgets/facttree.py
@@ -263,14 +263,6 @@ class FactTree(gtk.TreeView):
             for row in self.new_rows:
                 self.store_model.append((row, ))
 
-
-
-
-        # attach model is also where we calculate the bounding box widths
-        #self.set_model(self.store_model)
-
-        #self.parent.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
-
         if self.stored_selection:
             self.restore_selection()
 
@@ -462,6 +454,9 @@ class FactCellRenderer(gtk.GenericCellRenderer):
                         | tag, tag, some description                 |       |   |
           --------------+--------------------------------------------+-------+---+
         """
+        # set the colors
+        self.selected_color = widget.get_style().text[gtk.STATE_SELECTED]
+        self.normal_color = widget.get_style().text[gtk.STATE_NORMAL]
 
         context = window.cairo_create()
 
@@ -479,8 +474,10 @@ class FactCellRenderer(gtk.GenericCellRenderer):
         else:
             text_color = self.normal_color
 
+        self.date_label.color = text_color
+        self.duration_label.color = text_color
+
         if parent:
-            self.date_label.color = text_color
             self.date_label.text = "<b>%s</b>" % stuff.escape_pango(parent.label)
             self.date_label.x = 5
 
@@ -492,7 +489,6 @@ class FactCellRenderer(gtk.GenericCellRenderer):
             self.date_label.y = y
 
 
-            self.duration_label.color = text_color
             self.duration_label.text = "<b>%s</b>" % stuff.format_duration(parent.duration)
             self.duration_label.x = width - self.duration_label.width
             self.duration_label.y = y
@@ -510,10 +506,6 @@ class FactCellRenderer(gtk.GenericCellRenderer):
 
         g = graphics.Graphics(context)
 
-        # set the colors
-        self.selected_color = widget.get_style().text[gtk.STATE_SELECTED]
-        self.normal_color = widget.get_style().text[gtk.STATE_NORMAL]
-
         fact = self.data
 
         selected = flags and flags & gtk.CELL_RENDERER_SELECTED



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]