Change history icon if theme have 'document-open-recent' icon. Fixes #6893

This commit is contained in:
Denis Fomin 2013-08-23 11:26:48 +04:00
parent 9a78999565
commit 919310cac7
1 changed files with 19 additions and 4 deletions

View File

@ -5241,6 +5241,12 @@ class RosterWindow:
""" """
if not force and not self.actions_menu_needs_rebuild: if not force and not self.actions_menu_needs_rebuild:
return return
history_menuitem = self.xml.get_object('history_menuitem')
if gtkgui_helpers.gtk_icon_theme.has_icon('document-open-recent'):
history_icon = Gtk.Image()
history_icon.set_from_icon_name('document-open-recent',
Gtk.IconSize.MENU)
history_menuitem.set_image(history_icon)
new_chat_menuitem = self.xml.get_object('new_chat_menuitem') new_chat_menuitem = self.xml.get_object('new_chat_menuitem')
single_message_menuitem = self.xml.get_object( single_message_menuitem = self.xml.get_object(
'send_single_message_menuitem') 'send_single_message_menuitem')
@ -6173,6 +6179,11 @@ class RosterWindow:
menu.append(item) menu.append(item)
history_menuitem = Gtk.ImageMenuItem.new_with_mnemonic(_('_History')) history_menuitem = Gtk.ImageMenuItem.new_with_mnemonic(_('_History'))
if gtkgui_helpers.gtk_icon_theme.has_icon('document-open-recent'):
history_icon = Gtk.Image()
history_icon.set_from_icon_name('document-open-recent',
Gtk.IconSize.MENU)
else:
history_icon = Gtk.Image.new_from_stock(Gtk.STOCK_JUSTIFY_FILL, \ history_icon = Gtk.Image.new_from_stock(Gtk.STOCK_JUSTIFY_FILL, \
Gtk.IconSize.MENU) Gtk.IconSize.MENU)
if gtkgui_helpers.gtk_icon_theme.has_icon('document-open-recent'): if gtkgui_helpers.gtk_icon_theme.has_icon('document-open-recent'):
@ -6254,6 +6265,10 @@ class RosterWindow:
# History manager # History manager
item = Gtk.ImageMenuItem.new_with_mnemonic(_('History Manager')) item = Gtk.ImageMenuItem.new_with_mnemonic(_('History Manager'))
if gtkgui_helpers.gtk_icon_theme.has_icon('document-open-recent'):
icon = Gtk.Image()
icon.set_from_icon_name('document-open-recent', Gtk.IconSize.MENU)
else:
icon = Gtk.Image.new_from_stock(Gtk.STOCK_JUSTIFY_FILL, icon = Gtk.Image.new_from_stock(Gtk.STOCK_JUSTIFY_FILL,
Gtk.IconSize.MENU) Gtk.IconSize.MENU)
item.set_image(icon) item.set_image(icon)