(trunk-1586) Additional windows icon loading works better, and respect the theme changes.

This commit is contained in:
Stephen Boddy 2015-08-03 20:33:10 +02:00
parent 2686296cf6
commit 73d29ef997
3 changed files with 19 additions and 19 deletions

View File

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

View File

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

View File

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