Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2008-03-22 16:11:25 (GMT)
committer Simon Schampijer <simon@schampijer.de>2008-03-22 16:11:25 (GMT)
commit25abbc54692aa930bfcd7b6b9f4f297205869ff6 (patch)
tree346fada080b007bf60ae1ebea05755c3411c917a /sugar
parent99f406d0b9b5a4a7a88d967ac04821365f2e95bd (diff)
Fix when passing a pixel-size for the icon when not using the constructor
Diffstat (limited to 'sugar')
-rw-r--r--sugar/graphics/icon.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/sugar/graphics/icon.py b/sugar/graphics/icon.py
index 81a8232..9a96fa0 100644
--- a/sugar/graphics/icon.py
+++ b/sugar/graphics/icon.py
@@ -309,7 +309,10 @@ class Icon(gtk.Image):
if self._buffer.file_name != self.props.file:
self._buffer.file_name = self.props.file
- width, height = gtk.icon_size_lookup(self.props.icon_size)
+ if self.props.pixel_size == -1:
+ width, height = gtk.icon_size_lookup(self.props.icon_size)
+ else:
+ width = height = self.props.pixel_size
if self._buffer.width != width or self._buffer.height != height:
self._buffer.width = width
self._buffer.height = height
@@ -323,12 +326,6 @@ class Icon(gtk.Image):
def _file_changed_cb(self, image, pspec):
self._buffer.file_name = self.props.file
- def _update_buffer_size(self):
- width, height = gtk.icon_size_lookup(self.props.icon_size)
-
- self._buffer.width = width
- self._buffer.height = height
-
def do_size_request(self, requisition):
self._sync_image_properties()
surface = self._buffer.get_surface()