1. Set 'ibus-keyboard' icon for IME off in non-GNOME theme.
People would think the application icon for non-GNONE classic desktop.
The themed icon is applied for GNOME icon theme only.
2. Set gtk-fallback-icon-theme as 'gnome'
ibus gtk panel needs gtk stock icons but some desktop does not load GNOME
icon theme. I assigned 'gnome' for gtk-fallback-icon-theme if it's none.
3. Use 'gtk-dialog-info' if 'gtk-info' is not found.
It seems the latest gtk2 does not have 'gtk-info' icon via pygtk2.
BUG=RH#711632
TEST=Linux desktop
Review URL: http://codereview.appspot.com/
5320066
def get_ICON_KEYBOARD():
import gtk
- theme = gtk.icon_theme_get_default()
icon = '@IBUS_ICON_KEYBOARD@'
+ fallback_icon = 'ibus-keyboard'
+ settings = gtk.settings_get_default()
+ if settings.get_property('gtk-icon-theme-name') != 'gnome':
+ return fallback_icon
+ theme = gtk.icon_theme_get_default()
if not theme.lookup_icon(icon, 18, 0):
- icon = 'ibus-keyboard'
+ return fallback_icon
return icon
ISOCODES_PREFIX='@ISOCODES_PREFIX@'
pass
def launch_panel(replace):
+ settings = gtk.settings_get_default()
+ if settings.get_property('gtk-fallback-icon-theme') == None:
+ settings.set_property('gtk-fallback-icon-theme', 'gnome')
# gtk.settings_get_default().props.gtk_theme_name = "/home/phuang/.themes/aud-Default/gtk-2.0/gtkrc"
# gtk.rc_parse("./themes/default/gtkrc")
UIApplication(replace).run()
menu = gtk.Menu()
item = gtk.ImageMenuItem(_("No input window"))
size = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU)
- item.set_image(_icon.IconWidget("gtk-info", size[0]))
+ item.set_image(_icon.IconWidget("gtk-dialog-info", size[0]))
menu.add(item)
menu.show_all()
else: