[nautilus/gnome-3-20] nautilus-file: Don't show thumbnails for small zoom levels
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/gnome-3-20] nautilus-file: Don't show thumbnails for small zoom levels
- Date: Mon, 7 Mar 2016 20:08:25 +0000 (UTC)
commit 52dd77c43cb56f6d3572919d3a049ec4327bbbf6
Author: Alexandru Pandelea <alexandru pandelea gmail com>
Date: Thu Mar 3 07:30:43 2016 +0200
nautilus-file: Don't show thumbnails for small zoom levels
When the zoom level is too small, thumbnails become useless, as they are
so small that they don't give any information.
The solution to this problem is to use mimetype icons when the zoom
level is too small
In order to achieve this, there was added a function that returns
true if the zoom is too small, nautilus_thumbnail_is_limited_by_zoom,
meaning that the corresponding mimetype icon should be used instead
of the thumbnail
https://bugzilla.gnome.org/show_bug.cgi?id=752805
libnautilus-private/nautilus-file.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 22e29dd..1efe626 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -4581,6 +4581,20 @@ 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_LIST_ICON_SIZE_SMALL)
+ return TRUE;
+
+ return FALSE;
+}
+
NautilusIconInfo *
nautilus_file_get_icon (NautilusFile *file,
int size,
@@ -4608,7 +4622,8 @@ nautilus_file_get_icon (NautilusFile *file,
flags & NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE);
if (flags & NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS &&
- nautilus_file_should_show_thumbnail (file)) {
+ nautilus_file_should_show_thumbnail (file) &&
+ !nautilus_thumbnail_is_limited_by_zoom (size, scale)) {
icon = nautilus_file_get_thumbnail_icon (file, size, scale, flags);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]