Set icon size on the combobox.

This commit is contained in:
Tomeu Vizoso 2007-05-22 18:25:29 +02:00
parent 87d59ae13b
commit ffebebcd7d

View File

@ -19,6 +19,8 @@ import logging
import gobject import gobject
import gtk import gtk
from sugar.graphics import units
class ComboBox(gtk.ComboBox): class ComboBox(gtk.ComboBox):
__gtype_name__ = 'SugarComboBox' __gtype_name__ = 'SugarComboBox'
@ -51,6 +53,7 @@ class ComboBox(gtk.ComboBox):
def append_item(self, action_id, text, icon_name=None): def append_item(self, action_id, text, icon_name=None):
if not self._icon_renderer and icon_name: if not self._icon_renderer and icon_name:
self._icon_renderer = gtk.CellRendererPixbuf() self._icon_renderer = gtk.CellRendererPixbuf()
self._icon_renderer.props.stock_size = units.microgrid_to_pixels(3)
self.pack_start(self._icon_renderer, False) self.pack_start(self._icon_renderer, False)
self.add_attribute(self._icon_renderer, 'icon-name', 2) self.add_attribute(self._icon_renderer, 'icon-name', 2)