diff options
author | Dan Williams <dcbw@redhat.com> | 2007-01-26 14:21:56 (GMT) |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2007-01-26 14:21:56 (GMT) |
commit | 0eaa29ee9d3aac7514bdbe3e6ae087a3b51f336c (patch) | |
tree | 763950df65e57afdf6503fd8e24ca6cf9bc6b478 /sugar/graphics/canvasicon.py | |
parent | d35413d8b04d6bd565b8980d101125dbf9c9460c (diff) |
Set width/height the right way
Diffstat (limited to 'sugar/graphics/canvasicon.py')
-rw-r--r-- | sugar/graphics/canvasicon.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sugar/graphics/canvasicon.py b/sugar/graphics/canvasicon.py index 7da71f7..714ba30 100644 --- a/sugar/graphics/canvasicon.py +++ b/sugar/graphics/canvasicon.py @@ -145,6 +145,8 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem): self._buffers = {} self._cur_buffer = None self._size = 24 + self.props.box_width = self._size + self.props.box_height = self._size self._color = None self._icon_name = None self._cache = False @@ -175,6 +177,8 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem): if self._size != value and not self._cache: self._clear_buffers() self._size = value + self.props.box_width = value + self.props.box_height = value self.emit_request_changed() elif pspec.name == 'cache': self._cache = value @@ -229,11 +233,5 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem): cr.set_source_surface(buf, x, y) cr.paint() - def do_get_width_request(self): - return self._size - - def do_get_height_request(self, for_width): - return self._size - def _button_press_event_cb(self, item, event): item.emit_activated() |