diff options
author | António Fernandes <antoniof@gnome.org> | 2022-08-07 15:03:45 +0100 |
---|---|---|
committer | António Fernandes <antoniof@gnome.org> | 2022-09-01 09:28:40 +0100 |
commit | 3c9a154a3e86aff15e21a7e12dc305bcbeaf15ea (patch) | |
tree | f82aa489b260de4a45da730e44933351fb73c3a5 | |
parent | 735b6aae8817df8b8e1a8cdec2078035a854228d (diff) | |
download | nautilus-3c9a154a3e86aff15e21a7e12dc305bcbeaf15ea.tar.gz |
properties-window: Fix disproportionate icons
Thumbnails in Properties were sometimes larger than the requested size.
This is because we didn't pass the FORCE_THUMBNAIL_SIZE flag.
There were probably good reasons for this flag in the past, but there
are none now. If we request a size, that should be the size we get.
So, drop this flag entirely and default to forcing the size everywhere.
-rw-r--r-- | src/nautilus-dnd.c | 2 | ||||
-rw-r--r-- | src/nautilus-file.c | 12 | ||||
-rw-r--r-- | src/nautilus-file.h | 4 | ||||
-rw-r--r-- | src/nautilus-grid-cell.c | 3 | ||||
-rw-r--r-- | src/nautilus-name-cell.c | 3 |
5 files changed, 6 insertions, 18 deletions
diff --git a/src/nautilus-dnd.c b/src/nautilus-dnd.c index b6a87a1ba..e0f4a7177 100644 --- a/src/nautilus-dnd.c +++ b/src/nautilus-dnd.c @@ -242,7 +242,7 @@ get_paintable_for_drag_selection (GList *selection, /* The selection list is reversed compared to what the user sees. Get the * first items by starting from the end of the list. */ - flags = (NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS | NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE); + flags = NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS; for (GList *l = g_list_last (selection); l != NULL && g_queue_get_length (icons) <= MAX_DRAWN_DRAG_ICONS; l = l->prev) diff --git a/src/nautilus-file.c b/src/nautilus-file.c index 6a259816a..96ececa4c 100644 --- a/src/nautilus-file.c +++ b/src/nautilus-file.c @@ -5157,14 +5157,7 @@ nautilus_file_get_thumbnail_icon (NautilusFile *file, gicon = NULL; pixbuf = NULL; - if (flags & NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE) - { - modified_size = size * scale; - } - else - { - modified_size = size * scale * NAUTILUS_GRID_ICON_SIZE_MEDIUM / NAUTILUS_GRID_ICON_SIZE_SMALL; - } + modified_size = size * scale; if (file->details->thumbnail) { @@ -5293,8 +5286,7 @@ nautilus_file_get_icon (NautilusFile *file, goto out; } - DEBUG ("Called file_get_icon(), at size %d, force thumbnail %d", size, - flags & NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE); + DEBUG ("Called file_get_icon(), at size %d", size); if (flags & NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS && nautilus_file_should_show_thumbnail (file) && diff --git a/src/nautilus-file.h b/src/nautilus-file.h index 1cd331777..68c7ff931 100644 --- a/src/nautilus-file.h +++ b/src/nautilus-file.h @@ -82,10 +82,8 @@ typedef enum { NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS = (1<<0), NAUTILUS_FILE_ICON_FLAGS_IGNORE_VISITING = (1<<1), NAUTILUS_FILE_ICON_FLAGS_FOR_OPEN_FOLDER = (1<<2), - /* whether the thumbnail size must match the display icon size */ - NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE = (1<<3), /* uses the icon of the mount if present */ - NAUTILUS_FILE_ICON_FLAGS_USE_MOUNT_ICON = (1<<4), + NAUTILUS_FILE_ICON_FLAGS_USE_MOUNT_ICON = (1<<3), } NautilusFileIconFlags; #define NAUTILUS_THUMBNAIL_MINIMUM_ICON_SIZE 32 diff --git a/src/nautilus-grid-cell.c b/src/nautilus-grid-cell.c index 443e0df86..2e7538d76 100644 --- a/src/nautilus-grid-cell.c +++ b/src/nautilus-grid-cell.c @@ -40,8 +40,7 @@ update_icon (NautilusGridCell *self) g_return_if_fail (item != NULL); file = nautilus_view_item_get_file (item); icon_size = nautilus_view_item_get_icon_size (item); - flags = NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS | - NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE; + flags = NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS; icon_paintable = nautilus_file_get_icon_paintable (file, icon_size, 1, flags); gtk_picture_set_paintable (GTK_PICTURE (self->icon), icon_paintable); diff --git a/src/nautilus-name-cell.c b/src/nautilus-name-cell.c index cf46e17e6..bab99561b 100644 --- a/src/nautilus-name-cell.c +++ b/src/nautilus-name-cell.c @@ -137,8 +137,7 @@ update_icon (NautilusNameCell *self) file = nautilus_view_item_get_file (item); icon_size = nautilus_view_item_get_icon_size (item); - flags = NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS | - NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE; + flags = NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS; icon_paintable = nautilus_file_get_icon_paintable (file, icon_size, 1, flags); gtk_picture_set_paintable (GTK_PICTURE (self->icon), icon_paintable); |