ui/gtk/image.c

branch
newapi
changeset 312
3f2b3d15668b
parent 299
48763a9d19a7
child 327
216d8912714c
--- a/ui/gtk/image.c	Sun Sep 29 11:29:37 2024 +0200
+++ b/ui/gtk/image.c	Sun Sep 29 13:33:34 2024 +0200
@@ -126,7 +126,12 @@
 
 #if GTK_MAJOR_VERSION >= 4
 GdkPixbuf* ui_icon_pixbuf(UiIcon *icon) {
-    return NULL; // TODO
+    if(!icon->pixbuf) {
+        GFile *file = gtk_icon_paintable_get_file(icon->info);
+        GError *error = NULL;
+        icon->pixbuf = gdk_pixbuf_new_from_file(g_file_get_path(file), &error);
+    }
+    return icon->pixbuf;
 }
 #else
 GdkPixbuf* ui_icon_pixbuf(UiIcon *icon) {

mercurial