Tooth/src/Widgets/Emoji.vala

23 lines
457 B
Vala
Raw Permalink Normal View History

2022-11-17 18:32:26 +00:00
using Gtk;
using Gdk;
public class Tooth.Widgets.Emoji : Adw.Bin {
protected Image image;
construct {
image = new Gtk.Image ();
child = image;
}
public Emoji (string emoji_url) {
image_cache.request_paintable (emoji_url, on_cache_response);
}
void on_cache_response (bool is_loaded, owned Paintable? data) {
2022-12-11 00:23:29 +00:00
var image_widget = (child as Image);
if (child != null && image_widget != null)
image_widget.paintable = data;
2022-11-17 18:32:26 +00:00
}
}