EmoticonsPackPlugin. Show animated emoticons in Legend

This commit is contained in:
Denis Fomin
2013-04-30 17:05:17 +04:00
parent 4e86ef1fc0
commit 9ede8bf256

View File

@@ -158,7 +158,15 @@ class EmoticonsPackPlugin(GajimPlugin):
pbl = GdkPixbuf.PixbufLoader()
pbl.write(data)
pbl.close()
buff.insert_pixbuf(buff.get_end_iter(), pbl.get_pixbuf())
if icon.endswith('.gif'):
img = Gtk.Image()
img.set_from_animation(pbl.get_animation())
img.show()
anchor = buff.create_child_anchor(buff.get_end_iter())
self.emoticons_description_textview.add_child_at_anchor(
img, anchor)
else:
buff.insert_pixbuf(buff.get_end_iter(), pbl.get_pixbuf())
text = ' , '.join(emoticons.emoticons[icon])
buff.insert(buff.get_end_iter(), text + '\n', -1)