Replacing some of the icons. Fixes #7445
This commit is contained in:
parent
018171033f
commit
619500c3d4
5 changed files with 34 additions and 18 deletions
|
@ -1533,9 +1533,10 @@ class ChatControl(ChatControlBase):
|
|||
|
||||
self._send_file_button = self.xml.get_object('send_file_button')
|
||||
# add a special img for send file button
|
||||
path_to_upload_img = gtkgui_helpers.get_icon_path('gajim-upload')
|
||||
img = Gtk.Image()
|
||||
img.set_from_file(path_to_upload_img)
|
||||
pixbuf = gtkgui_helpers.get_icon_pixmap('document-send', quiet=True)
|
||||
if not pixbuf:
|
||||
pixbuf = gtkgui_helpers.get_icon_pixmap('gajim-upload')
|
||||
img = Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
self._send_file_button.set_image(img)
|
||||
id_ = self._send_file_button.connect('clicked',
|
||||
self._on_send_file_menuitem_activate)
|
||||
|
|
|
@ -175,12 +175,21 @@ class ConversationTextview(GObject.GObject):
|
|||
|
||||
FOCUS_OUT_LINE_PIXBUF = gtkgui_helpers.get_icon_pixmap(
|
||||
'gajim-muc_separator')
|
||||
XEP0184_WARNING_PIXBUF = gtkgui_helpers.get_icon_pixmap(
|
||||
'gajim-receipt_missing')
|
||||
XEP0184_RECEIVED_PIXBUF = gtkgui_helpers.get_icon_pixmap(
|
||||
'gajim-receipt_received')
|
||||
XEP0184_WARNING_PIXBUF = gtkgui_helpers.get_icon_pixmap('gtk-no',
|
||||
quiet=True)
|
||||
if not XEP0184_WARNING_PIXBUF:
|
||||
MESSAGE_CORRECTED_PIXBUF = gtkgui_helpers.get_icon_pixmap(
|
||||
'gajim-receipt_missing')
|
||||
XEP0184_RECEIVED_PIXBUF = gtkgui_helpers.get_icon_pixmap('gtk-yes',
|
||||
quiet=True)
|
||||
if not XEP0184_RECEIVED_PIXBUF:
|
||||
MESSAGE_CORRECTED_PIXBUF = gtkgui_helpers.get_icon_pixmap(
|
||||
'gajim-receipt_received')
|
||||
MESSAGE_CORRECTED_PIXBUF = gtkgui_helpers.get_icon_pixmap(
|
||||
'gajim-message_corrected')
|
||||
'gtk-spell-check', quiet=True)
|
||||
if not MESSAGE_CORRECTED_PIXBUF:
|
||||
MESSAGE_CORRECTED_PIXBUF = gtkgui_helpers.get_icon_pixmap(
|
||||
'gajim-message_corrected')
|
||||
|
||||
# smooth scroll constants
|
||||
MAX_SCROLL_TIME = 0.4 # seconds
|
||||
|
|
|
@ -2553,9 +2553,10 @@ class GroupchatControl(ChatControlBase):
|
|||
|
||||
item = xml.get_object('send_file_menuitem')
|
||||
# add a special img for send file menuitem
|
||||
path_to_upload_img = gtkgui_helpers.get_icon_path('gajim-upload')
|
||||
img = Gtk.Image()
|
||||
img.set_from_file(path_to_upload_img)
|
||||
pixbuf = gtkgui_helpers.get_icon_pixmap('document-send', quiet=True)
|
||||
if not pixbuf:
|
||||
pixbuf = gtkgui_helpers.get_icon_pixmap('gajim-upload')
|
||||
img = Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
item.set_image(img)
|
||||
|
||||
if not c.resource:
|
||||
|
|
|
@ -46,11 +46,12 @@ from common import pep
|
|||
gtk_icon_theme = Gtk.IconTheme.get_default()
|
||||
gtk_icon_theme.append_search_path(gajim.ICONS_DIR)
|
||||
|
||||
def get_icon_pixmap(icon_name, size=16):
|
||||
def get_icon_pixmap(icon_name, size=16, quiet=False):
|
||||
try:
|
||||
return gtk_icon_theme.load_icon(icon_name, size, 0)
|
||||
except GObject.GError as e:
|
||||
log.error('Unable to load icon %s: %s' % (icon_name, str(e)))
|
||||
if not quiet:
|
||||
log.error('Unable to load icon %s: %s' % (icon_name, str(e)))
|
||||
|
||||
def get_icon_path(icon_name, size=16):
|
||||
try:
|
||||
|
@ -988,8 +989,11 @@ def get_pep_as_pixbuf(pep_class):
|
|||
else:
|
||||
return load_activity_icon('unknown').get_pixbuf()
|
||||
elif isinstance(pep_class, pep.UserLocationPEP):
|
||||
path = get_icon_path('gajim-earth')
|
||||
return GdkPixbuf.Pixbuf.new_from_file(path)
|
||||
icon = gtkgui_helpers.get_icon_pixmap('applications-internet',
|
||||
quiet=True)
|
||||
if not icon:
|
||||
icon = gtkgui_helpers.get_icon_pixmap('gajim-earth')
|
||||
return icon
|
||||
return None
|
||||
|
||||
def load_icons_meta():
|
||||
|
|
|
@ -206,9 +206,10 @@ control=None, gc_contact=None, is_anonymous=True):
|
|||
items_to_hide = []
|
||||
|
||||
# add a special img for send file menuitem
|
||||
path_to_upload_img = gtkgui_helpers.get_icon_path('gajim-upload')
|
||||
img = Gtk.Image()
|
||||
img.set_from_file(path_to_upload_img)
|
||||
pixbuf = gtkgui_helpers.get_icon_pixmap('document-send', quiet=True)
|
||||
if not pixbuf:
|
||||
pixbuf = gtkgui_helpers.get_icon_pixmap('gajim-upload')
|
||||
img = Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
send_file_menuitem.set_image(img)
|
||||
|
||||
if not our_jid:
|
||||
|
|
Loading…
Add table
Reference in a new issue