Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/activity.py
diff options
context:
space:
mode:
authorAgustin Zubiaga <aguzubiaga97@gmail.com>2012-02-03 15:58:44 (GMT)
committer Agustin Zubiaga <aguzubiaga97@gmail.com>2012-02-03 15:58:44 (GMT)
commita4345e0531c8424cd40ab669aa62018bfa177c24 (patch)
treea6b42f75782ea5f2c7b8b2099207bd9e63e0770e /activity.py
parenta87ef2e89ed462141bbb812661d8bee6ad523839 (diff)
Resize the chart for all the screen sizes
Diffstat (limited to 'activity.py')
-rw-r--r--activity.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/activity.py b/activity.py
index 8a5a387..7faa454 100644
--- a/activity.py
+++ b/activity.py
@@ -198,6 +198,7 @@ class SimpleGraph(activity.Activity):
# CANVAS
paned = gtk.HPaned()
box = gtk.VBox()
+ self.box = box
# Set the info box width to 1/3 of the screen:
def size_allocate_cb(widget, allocation):
@@ -260,6 +261,21 @@ class SimpleGraph(activity.Activity):
def _render_chart(self):
if self.current_chart is None:
return
+
+ # Resize the chart for all the screen sizes
+ x, y, w, h = self.get_allocation()
+ bx, by, bw, bh = self.box.get_allocation()
+
+ surface_max_height = self.charts_area.get_allocation().height
+ print surface_max_height
+
+ new_width = w - bw - 40
+ new_height = surface_max_height - 40
+
+ self.current_chart.width = new_width
+ self.current_chart.height = new_height
+
+ # Set options
self.current_chart.set_color_scheme(color=self.chart_color)
self.current_chart.set_line_color(self.chart_line_color)
if self.current_chart.type == "pie":