diff options
author | Reinier Heeres <rwh@rwh.(none)> | 2007-11-09 09:41:54 (GMT) |
---|---|---|
committer | Reinier Heeres <rwh@rwh.(none)> | 2007-11-09 09:41:54 (GMT) |
commit | ef3fe93985c3232d44781150bdf58cefe3c382bd (patch) | |
tree | 27ec682d99c95688bebfc842e5ca7f1fd827f809 /shell | |
parent | 9881a3c4c4e9c44389d9968aa4289c4e23e69b8c (diff) |
Make donut activity size fixed, #3605
Diffstat (limited to 'shell')
-rwxr-xr-x | shell/view/home/activitiesdonut.py | 20 |
1 files changed, 19 insertions, 1 deletions
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 |