From 25abbc54692aa930bfcd7b6b9f4f297205869ff6 Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Sat, 22 Mar 2008 16:11:25 +0000 Subject: Fix when passing a pixel-size for the icon when not using the constructor --- (limited to 'sugar/graphics') 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() -- cgit v0.9.1