Fix when passing a pixel-size for the icon when not using the constructor

This commit is contained in:
Simon Schampijer 2008-03-22 17:11:25 +01:00
parent 99f406d0b9
commit 25abbc5469

View File

@ -309,7 +309,10 @@ class Icon(gtk.Image):
if self._buffer.file_name != self.props.file: if self._buffer.file_name != self.props.file:
self._buffer.file_name = self.props.file self._buffer.file_name = self.props.file
if self.props.pixel_size == -1:
width, height = gtk.icon_size_lookup(self.props.icon_size) 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: if self._buffer.width != width or self._buffer.height != height:
self._buffer.width = width self._buffer.width = width
self._buffer.height = height self._buffer.height = height
@ -323,12 +326,6 @@ class Icon(gtk.Image):
def _file_changed_cb(self, image, pspec): def _file_changed_cb(self, image, pspec):
self._buffer.file_name = self.props.file 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): def do_size_request(self, requisition):
self._sync_image_properties() self._sync_image_properties()
surface = self._buffer.get_surface() surface = self._buffer.get_surface()