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 type;
|
||||||
public string url;
|
public string url;
|
||||||
public string preview_url;
|
public string preview_url;
|
||||||
|
public string? description;
|
||||||
|
|
||||||
public Attachment(int64 id){
|
public Attachment(int64 id){
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
@ -17,6 +18,9 @@ public class Tootle.Attachment{
|
||||||
attachment.preview_url = obj.get_string_member ("preview_url");
|
attachment.preview_url = obj.get_string_member ("preview_url");
|
||||||
attachment.url = obj.get_string_member ("url");
|
attachment.url = obj.get_string_member ("url");
|
||||||
|
|
||||||
|
if (obj.has_member ("description"))
|
||||||
|
attachment.description = obj.get_string_member ("description");
|
||||||
|
|
||||||
return attachment;
|
return attachment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ public class Tootle.AttachmentWidget : Gtk.EventBox {
|
||||||
image.valign = Gtk.Align.CENTER;
|
image.valign = Gtk.Align.CENTER;
|
||||||
image.halign = Gtk.Align.CENTER;
|
image.halign = Gtk.Align.CENTER;
|
||||||
image.margin = 3;
|
image.margin = 3;
|
||||||
|
image.set_tooltip_text (attachment.description);
|
||||||
image.show ();
|
image.show ();
|
||||||
if (editable)
|
if (editable)
|
||||||
Tootle.network.load_scaled_image (attachment.preview_url, image, get_small_size ());
|
Tootle.network.load_scaled_image (attachment.preview_url, image, get_small_size ());
|
||||||
|
|
Loading…
Reference in New Issue