[preview] Display preview beginning with a new line and add tooltip

This commit is contained in:
Daniel
2017-12-19 20:29:33 +01:00
parent f03191286b
commit 2b3769f6e6
2 changed files with 3 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
[info] [info]
name: Url image preview name: Url image preview
short_name: url_image_preview short_name: url_image_preview
version: 2.1.2 version: 2.1.3
description: Displays a preview of links to images description: Displays a preview of links to images
authors = Denis Fomin <fominde@gmail.com> authors = Denis Fomin <fominde@gmail.com>
Yann Leboulanger <asterix@lagaule.org> Yann Leboulanger <asterix@lagaule.org>

View File

@@ -360,13 +360,14 @@ class Base(object):
buffer_ = repl_start.get_buffer() buffer_ = repl_start.get_buffer()
iter_ = buffer_.get_iter_at_mark(repl_start) iter_ = buffer_.get_iter_at_mark(repl_start)
buffer_.insert(iter_, "\n")
anchor = buffer_.create_child_anchor(iter_) anchor = buffer_.create_child_anchor(iter_)
if isinstance(pixbuf, GdkPixbuf.PixbufAnimation): if isinstance(pixbuf, GdkPixbuf.PixbufAnimation):
image = Gtk.Image.new_from_animation(pixbuf) image = Gtk.Image.new_from_animation(pixbuf)
else: else:
image = Gtk.Image.new_from_pixbuf(pixbuf) image = Gtk.Image.new_from_pixbuf(pixbuf)
event_box.set_tooltip_text(url)
event_box.add(image) event_box.add(image)
event_box.show_all() event_box.show_all()
self.textview.tv.add_child_at_anchor(event_box, anchor) self.textview.tv.add_child_at_anchor(event_box, anchor)