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; |