Additional windows icon loading works better, and respect the theme changes.

This commit is contained in:
Stephen Boddy 2015-08-02 06:20:53 +02:00
parent aa0dd2d364
commit 8ff835556e
3 changed files with 19 additions and 19 deletions

View File

@ -46,11 +46,11 @@ class LayoutLauncher:
self.builder.add_from_string(gladedata) self.builder.add_from_string(gladedata)
self.window = self.builder.get_object('layoutlauncherwin') self.window = self.builder.get_object('layoutlauncherwin')
icon_theme = gtk.IconTheme() icon_theme = gtk.icon_theme_get_default()
try: if icon_theme.lookup_icon('terminator-layout', 48, 0):
icon = icon_theme.load_icon('terminator-layout', 48, 0) self.window.set_icon_name('terminator-layout')
except (NameError, gobject.GError): else:
dbg('Unable to load 48px Terminator preferences icon') dbg('Unable to load Terminator layout launcher icon')
icon = self.window.render_icon(gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_BUTTON) icon = self.window.render_icon(gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_BUTTON)
self.window.set_icon(icon) self.window.set_icon(icon)

View File

@ -71,7 +71,7 @@ class CustomCommandsMenu(plugin.MenuItem):
menuitem = gtk.SeparatorMenuItem() menuitem = gtk.SeparatorMenuItem()
submenu.append(menuitem) submenu.append(menuitem)
theme = gtk.IconTheme() theme = gtk.icon_theme_get_default()
for command in [ self.cmd_list[key] for key in sorted(self.cmd_list.keys()) ] : for command in [ self.cmd_list[key] for key in sorted(self.cmd_list.keys()) ] :
if not command['enabled']: if not command['enabled']:
continue continue
@ -126,11 +126,11 @@ class CustomCommandsMenu(plugin.MenuItem):
) )
) )
icon_theme = gtk.IconTheme() icon_theme = gtk.icon_theme_get_default()
try: if icon_theme.lookup_icon('terminator-custom-commands', 48, 0):
icon = icon_theme.load_icon('terminator-custom-commands', 48, 0) dbox.set_icon_name('terminator-custom-commands')
except (NameError, gobject.GError): else:
dbg('Unable to load 48px Terminator preferences icon') dbg('Unable to load Terminator custom command icon')
icon = dbox.render_icon(gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_BUTTON) icon = dbox.render_icon(gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_BUTTON)
dbox.set_icon(icon) dbox.set_icon(icon)

View File

@ -172,11 +172,11 @@ class PrefsEditor:
self.builder.add_from_string(gladedata) self.builder.add_from_string(gladedata)
self.window = self.builder.get_object('prefswin') self.window = self.builder.get_object('prefswin')
icon_theme = gtk.IconTheme() icon_theme = gtk.icon_theme_get_default()
try: if icon_theme.lookup_icon('terminator-preferences', 48, 0):
icon = icon_theme.load_icon('terminator-preferences', 48, 0) self.window.set_icon_name('terminator-preferences')
except (NameError, gobject.GError): else:
dbg('Unable to load 48px Terminator preferences icon') dbg('Unable to load Terminator preferences icon')
icon = self.window.render_icon(gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_BUTTON) icon = self.window.render_icon(gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_BUTTON)
self.window.set_icon(icon) self.window.set_icon(icon)