Add colors to icons in menu items

This commit is contained in:
Tomeu Vizoso 2008-12-05 18:02:13 +01:00
parent 33e94723da
commit e0c2017c50

View File

@ -28,7 +28,8 @@ import gtk
from sugar.graphics.icon import Icon
class MenuItem(gtk.ImageMenuItem):
def __init__(self, text_label=None, icon_name=None, text_maxlen=0):
def __init__(self, text_label=None, icon_name=None, text_maxlen=0,
xo_color=None):
gobject.GObject.__init__(self)
self._accelerator = None
@ -43,6 +44,8 @@ class MenuItem(gtk.ImageMenuItem):
if icon_name:
icon = Icon(icon_name=icon_name, icon_size=gtk.ICON_SIZE_MENU)
if xo_color is not None:
icon.props.xo_color = xo_color
self.set_image(icon)
icon.show()