(trunk-1586) Additional windows icon loading works better, and respect the theme changes.
This commit is contained in:
parent
2686296cf6
commit
73d29ef997
|
@ -46,13 +46,13 @@ 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.IconTheme.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.IconSize.BUTTON)
|
icon = self.window.render_icon(Gtk.STOCK_DIALOG_INFO, Gtk.IconSize.BUTTON)
|
||||||
self.window.set_icon(icon)
|
self.window.set_icon(icon)
|
||||||
|
|
||||||
self.builder.connect_signals(self)
|
self.builder.connect_signals(self)
|
||||||
self.window.connect('destroy', self.on_destroy_event)
|
self.window.connect('destroy', self.on_destroy_event)
|
||||||
|
|
|
@ -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.IconTheme.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,13 +126,13 @@ class CustomCommandsMenu(plugin.MenuItem):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
icon_theme = Gtk.IconTheme()
|
icon_theme = Gtk.IconTheme.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.IconSize.BUTTON)
|
icon = dbox.render_icon(Gtk.STOCK_DIALOG_INFO, Gtk.IconSize.BUTTON)
|
||||||
dbox.set_icon(icon)
|
dbox.set_icon(icon)
|
||||||
|
|
||||||
store = Gtk.ListStore(bool, str, str)
|
store = Gtk.ListStore(bool, str, str)
|
||||||
|
|
||||||
|
|
|
@ -173,13 +173,13 @@ 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.IconTheme.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.IconSize.BUTTON)
|
icon = self.window.render_icon(Gtk.STOCK_DIALOG_INFO, Gtk.IconSize.BUTTON)
|
||||||
self.window.set_icon(icon)
|
self.window.set_icon(icon)
|
||||||
|
|
||||||
self.layouteditor = LayoutEditor(self.builder)
|
self.layouteditor = LayoutEditor(self.builder)
|
||||||
self.builder.connect_signals(self)
|
self.builder.connect_signals(self)
|
||||||
|
|
Loading…
Reference in New Issue