summaryrefslogtreecommitdiff
path: root/src/nautilus-file.c
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2021-10-31 21:34:50 +0000
committerAntónio Fernandes <antoniof@gnome.org>2021-12-29 11:35:44 +0000
commitf1170492a972f3fc922b56fb4a2967316df95027 (patch)
treefcf1c2126b803687e73014a11864c34a82722fd5 /src/nautilus-file.c
parentdac9a57b85b7dd3f17dcff3658317845d7ed3484 (diff)
downloadnautilus-f1170492a972f3fc922b56fb4a2967316df95027.tar.gz
Revert "nautilus-file.c: Add transparent padding to thumbnails"
This reverts commit 26d33d74f468a8ab10b4a1c3c8aa66b66205e112. It was a hack to fix an issue with the way GTK 3 renders GEmblemedIcon. But GTK4 has dropped support for rendering GEmblemedIcon[0], so we aren't going to have any need for this hack going forward. Also, the new icon view now draws shadows around thumbnails. But due to this hack, the shadow would always go around the invisible square. [0] https://gitlab.gnome.org/GNOME/nautilus/-/issues/2017
Diffstat (limited to 'src/nautilus-file.c')
-rw-r--r--src/nautilus-file.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 9498e81e4..704354efc 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -5240,9 +5240,6 @@ nautilus_file_get_thumbnail_icon (NautilusFile *file,
}
else
{
- GdkPixbuf *bg_pixbuf;
- int bg_size;
-
pixbuf = gdk_pixbuf_scale_simple (file->details->thumbnail,
MAX (w * thumb_scale, 1),
MAX (h * thumb_scale, 1),
@@ -5264,32 +5261,13 @@ nautilus_file_get_thumbnail_icon (NautilusFile *file,
}
}
- /* Copy to a transparent square pixbuf, aligned to the bottom edge */
- bg_size = MAX (gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf));
- bg_pixbuf = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (pixbuf),
- TRUE,
- gdk_pixbuf_get_bits_per_sample (pixbuf),
- bg_size,
- bg_size);
- gdk_pixbuf_fill (bg_pixbuf, 0);
- gdk_pixbuf_copy_area (pixbuf,
- 0,
- 0,
- gdk_pixbuf_get_width (pixbuf),
- gdk_pixbuf_get_height (pixbuf),
- bg_pixbuf,
- (bg_size - gdk_pixbuf_get_width (pixbuf)) / 2,
- (bg_size - gdk_pixbuf_get_height (pixbuf)));
- g_clear_object (&pixbuf);
- pixbuf = bg_pixbuf;
-
g_clear_object (&file->details->scaled_thumbnail);
file->details->scaled_thumbnail = pixbuf;
file->details->thumbnail_scale = thumb_scale;
}
DEBUG ("Returning thumbnailed image, at size %d %d",
- gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf));
+ (int) (w * thumb_scale), (int) (h * thumb_scale));
}
else if (file->details->thumbnail_path == NULL &&
file->details->can_read &&