Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar

This commit is contained in:
Dan Williams 2006-09-25 14:15:49 -04:00
commit 550c201101
4 changed files with 13 additions and 4 deletions

View File

@ -67,8 +67,12 @@ class MeshModel(gobject.GObject):
def _buddy_activity_changed_cb(self, buddy, cur_activity):
buddy_model = self._buddies[buddy.get_name()]
activity_model = self._activities[cur_activity.get_id()]
self.emit('buddy-moved', buddy_model, activity_model)
if cur_activity == None:
self.emit('buddy-moved', buddy_model, None)
else:
activity_model = self._activities[cur_activity.get_id()]
self.emit('buddy-moved', buddy_model, activity_model)
def _buddy_appeared_cb(self, pservice, buddy):
model = BuddyModel(buddy=buddy)

View File

@ -117,7 +117,7 @@ class MeshGroup(goocanvas.Group):
self._remove_buddy(buddy_model)
if activity_model == None:
self.add_buddy(buddy_model)
self._add_alone_buddy(buddy_model)
else:
activity = self._activities[activity_model.get_id()]

View File

@ -28,7 +28,7 @@ class SnowflakeLayout:
[width, height] = self._root.get_size_request()
matrix = cairo.Matrix(1, 0, 0, 1, 0, 0)
matrix.translate(self._cx - (width / 2), self._cy - (height / 2))
matrix.translate(self._cx, self._cy)
self._root.set_transform(matrix)
def _layout_child(self, child, index):

View File

@ -60,6 +60,11 @@ group.translate(500, 500)
_create_snowflake(group, 8)
root.add_child(group)
layout = SnowflakeLayout()
group = goocanvas.Group()
group.translate(20, 500)
_create_snowflake(group, 2)
root.add_child(group)
canvas.set_model(canvas_model)