summaryrefslogtreecommitdiff
path: root/src/nautilus-file.c
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2022-01-01 17:06:19 +0000
committerAntónio Fernandes <antoniof@gnome.org>2022-01-05 12:56:32 +0000
commitcfbe15ffa08351819e078c3887f704e3a5d008f8 (patch)
treecafff20c53d184dd6fb60174a006f825dc9b940b /src/nautilus-file.c
parente59e1dd9f1ebb3c0cf1370b6da10c3c07289d310 (diff)
downloadnautilus-cfbe15ffa08351819e078c3887f704e3a5d008f8.tar.gz
general: GdkPixbuf -> GdkPaintable/GdkTexture
Generally we should be able to use any paintable. Unfortunately GtkCellRendererPixbuf doesn't accept paintables other than textures. The other two usages of textures require a GIcon. We could create a GThemedIcon using GtkIconPaintable:icon-name, but to keep changes at a minimum short here, that's left for a later enhancement.
Diffstat (limited to 'src/nautilus-file.c')
-rw-r--r--src/nautilus-file.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 011842bd1..36c1462e4 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -5378,17 +5378,30 @@ out:
return icon;
}
-GdkPixbuf *
-nautilus_file_get_icon_pixbuf (NautilusFile *file,
- int size,
- int scale,
- NautilusFileIconFlags flags)
+GdkTexture *
+nautilus_file_get_icon_texture (NautilusFile *file,
+ int size,
+ int scale,
+ NautilusFileIconFlags flags)
{
g_autoptr (NautilusIconInfo) info = NULL;
info = nautilus_file_get_icon (file, size, scale, flags);
- return nautilus_icon_info_get_pixbuf_at_size (info, size);
+ return nautilus_icon_info_get_texture (info);
+}
+
+GdkPaintable *
+nautilus_file_get_icon_paintable (NautilusFile *file,
+ int size,
+ int scale,
+ NautilusFileIconFlags flags)
+{
+ g_autoptr (NautilusIconInfo) info = NULL;
+
+ info = nautilus_file_get_icon (file, size, scale, flags);
+
+ return nautilus_icon_info_get_paintable (info);
}
gboolean