Display image tooltips (#54)
This commit is contained in:
parent
58793b0d4b
commit
56258c8e50
|
@ -4,6 +4,7 @@ public class Tootle.Attachment{
|
|||
public string type;
|
||||
public string url;
|
||||
public string preview_url;
|
||||
public string? description;
|
||||
|
||||
public Attachment(int64 id){
|
||||
this.id = id;
|
||||
|
@ -17,6 +18,9 @@ public class Tootle.Attachment{
|
|||
attachment.preview_url = obj.get_string_member ("preview_url");
|
||||
attachment.url = obj.get_string_member ("url");
|
||||
|
||||
if (obj.has_member ("description"))
|
||||
attachment.description = obj.get_string_member ("description");
|
||||
|
||||
return attachment;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ public class Tootle.AttachmentWidget : Gtk.EventBox {
|
|||
image.valign = Gtk.Align.CENTER;
|
||||
image.halign = Gtk.Align.CENTER;
|
||||
image.margin = 3;
|
||||
image.set_tooltip_text (attachment.description);
|
||||
image.show ();
|
||||
if (editable)
|
||||
Tootle.network.load_scaled_image (attachment.preview_url, image, get_small_size ());
|
||||
|
|
Loading…
Reference in New Issue