[hamster-applet] make statistics chart static as it is not hooked to any events anyway



commit 98412e9fe41528c8af47c877e0c90720acb3d063
Author: Toms Bauģis <toms baugis gmail com>
Date:   Thu Aug 12 00:11:16 2010 +0100

    make statistics chart static as it is not hooked to any events anyway

 src/hamster/stats.py             |    1 +
 src/hamster/widgets/timechart.py |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/hamster/stats.py b/src/hamster/stats.py
index 4fe3fd3..810a0a1 100644
--- a/src/hamster/stats.py
+++ b/src/hamster/stats.py
@@ -50,6 +50,7 @@ class Stats(object):
         day_start = conf.get("day_start_minutes")
         day_start = dt.time(day_start / 60, day_start % 60)
         self.timechart = widgets.TimeChart()
+        self.timechart.interactive = False
         self.timechart.day_start = day_start
 
         self.get_widget("explore_everything").add(self.timechart)
diff --git a/src/hamster/widgets/timechart.py b/src/hamster/widgets/timechart.py
index 301b53e..6bf5451 100644
--- a/src/hamster/widgets/timechart.py
+++ b/src/hamster/widgets/timechart.py
@@ -281,7 +281,7 @@ class TimeChart(graphics.Scene):
             if not bar.fill:
                 bar.fill = self.bar_color
 
-            bar.key_label.interactive = (self.end_time - self.start_time) > dt.timedelta(10) and self.minor_tick == DAY
+            bar.key_label.interactive = self.interactive and (self.end_time - self.start_time) > dt.timedelta(10) and self.minor_tick == DAY
 
             if (self.end_time - self.start_time) > dt.timedelta(10) \
                and self.minor_tick == DAY and first_weekday(bar.key) == False:
@@ -420,7 +420,7 @@ class TimeChart(graphics.Scene):
         for i, (key, value, normalized) in enumerate(zip(fractions, hours, normalized_hours)):
             bar = VerticalBar(key, step_format, value, normalized)
             bar.z_order = len(fractions) - i
-            bar.interactive = self.minor_tick >= DAY and bar.value > 0
+            bar.interactive = self.interactive and self.minor_tick >= DAY and bar.value > 0
 
             self.add_child(bar)
             self.bars.append(bar)



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