summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2022-12-15 12:14:37 +0000
committerAntónio Fernandes <antoniof@gnome.org>2023-01-06 19:34:10 +0000
commita7a682a712fcd78f68430fd7ced65dfe0d0f00c1 (patch)
treed16dfcdf70108fae85968dd00c3c9bf9c73ead4c
parenta9fa61ecafc63089282e4d8d71f194f5cfc4c905 (diff)
downloadnautilus-a7a682a712fcd78f68430fd7ced65dfe0d0f00c1.tar.gz
file: Check minimum thumbnail size independently from scale
We've been allowing thumbnails at smaller sizes if the screen density is larger. This goes back to 7059cc66ca3bc338e49a6ac4cb37c3484ba3b19d This leads to inconsistent results depending on the screen density. Also, the human eye is the limiting factor here. So, replace the helper function with a simple size check. Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1804
-rw-r--r--src/nautilus-file.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 46e9ac9fc..b340cfc73 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -5156,22 +5156,6 @@ nautilus_file_get_thumbnail_icon (NautilusFile *file,
return icon;
}
-static gboolean
-nautilus_thumbnail_is_limited_by_zoom (int size,
- int scale)
-{
- int zoom_level;
-
- zoom_level = size * scale;
-
- if (zoom_level < NAUTILUS_THUMBNAIL_MINIMUM_ICON_SIZE)
- {
- return TRUE;
- }
-
- return FALSE;
-}
-
NautilusIconInfo *
nautilus_file_get_icon (NautilusFile *file,
int size,
@@ -5201,7 +5185,7 @@ nautilus_file_get_icon (NautilusFile *file,
if (flags & NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS &&
nautilus_file_should_show_thumbnail (file) &&
- !nautilus_thumbnail_is_limited_by_zoom (size, scale))
+ size >= NAUTILUS_THUMBNAIL_MINIMUM_ICON_SIZE)
{
icon = nautilus_file_get_thumbnail_icon (file, size, scale, flags);
}