ui/gtk/image.c

branch
newapi
changeset 312
3f2b3d15668b
parent 299
48763a9d19a7
equal deleted inserted replaced
311:450a813dc2a5 312:3f2b3d15668b
124 return get_icon(name, size, 1); 124 return get_icon(name, size, 1);
125 } 125 }
126 126
127 #if GTK_MAJOR_VERSION >= 4 127 #if GTK_MAJOR_VERSION >= 4
128 GdkPixbuf* ui_icon_pixbuf(UiIcon *icon) { 128 GdkPixbuf* ui_icon_pixbuf(UiIcon *icon) {
129 return NULL; // TODO 129 if(!icon->pixbuf) {
130 GFile *file = gtk_icon_paintable_get_file(icon->info);
131 GError *error = NULL;
132 icon->pixbuf = gdk_pixbuf_new_from_file(g_file_get_path(file), &error);
133 }
134 return icon->pixbuf;
130 } 135 }
131 #else 136 #else
132 GdkPixbuf* ui_icon_pixbuf(UiIcon *icon) { 137 GdkPixbuf* ui_icon_pixbuf(UiIcon *icon) {
133 if(!icon->pixbuf) { 138 if(!icon->pixbuf) {
134 GError *error = NULL; 139 GError *error = NULL;

mercurial