Set the icon-set property to avoid resetting the icon_size

This commit is contained in:
Marco Pesenti Gritti 2007-08-18 01:04:10 +02:00
parent e6ab812294
commit 6a5f389436

View File

@ -78,7 +78,7 @@ class Icon(gtk.Image):
source.set_state(gtk.STATE_INSENSITIVE) source.set_state(gtk.STATE_INSENSITIVE)
icon_set.add_source(source) icon_set.add_source(source)
self.set_from_icon_set(icon_set, self.props.icon_size) self.props.icon_set = icon_set
def _update_icon(self): def _update_icon(self):
if not self._constructed: if not self._constructed:
@ -126,12 +126,12 @@ class Icon(gtk.Image):
elif pspec.name == 'stroke-color': elif pspec.name == 'stroke-color':
self._stroke_color = value self._stroke_color = value
self._update_icon() self._update_icon()
elif pspec.name == 'icon-size':
gtk.Image.do_set_property(self, pspec, value)
self._update_icon()
else: else:
gtk.Image.do_set_property(self, pspec, value) gtk.Image.do_set_property(self, pspec, value)
if pspec.name == 'icon-size':
self._update_icon()
def do_get_property(self, pspec): def do_get_property(self, pspec):
if pspec.name == 'fill-color': if pspec.name == 'fill-color':
return self._fill_color return self._fill_color