From ef3fe93985c3232d44781150bdf58cefe3c382bd Mon Sep 17 00:00:00 2001 From: Reinier Heeres Date: Fri, 09 Nov 2007 09:41:54 +0000 Subject: Make donut activity size fixed, #3605 --- (limited to 'shell') diff --git a/shell/view/home/activitiesdonut.py b/shell/view/home/activitiesdonut.py index e2e7d36..51a222a 100755 --- a/shell/view/home/activitiesdonut.py +++ b/shell/view/home/activitiesdonut.py @@ -32,7 +32,7 @@ from sugar.graphics import xocolor from sugar import profile import proc_smaps -_MAX_ACTIVITIES = 10 +_MAX_ACTIVITIES = 6 _MIN_WEDGE_SIZE = 1.0 / _MAX_ACTIVITIES _DONUT_SIZE = style.zoom(450) @@ -291,7 +291,25 @@ class ActivitiesDonut(hippo.CanvasBox, hippo.CanvasItem): activity_host.present() return True + def _set_fixed_arc_size(self): + """Set fixed arc size""" + + n = len(self._activities) + if n > _MAX_ACTIVITIES: + size = 1.0 / n + else: + size = 1.0 / _MAX_ACTIVITIES + + for act in self._activities: + act.size = size + def _update_activity_sizes(self): + """Currently the size of an activity on the donut does not + represent it's memory usage. This is disabled because it was + either not working perfectly or a little confusing. See #3605""" + self._set_fixed_arc_size() + return + # Get the memory mappings of each process that hosts an # activity, and count how many activity instances each # activity process hosts, and how many processes are mapping -- cgit v0.9.1