diff options
author | Alexander Larsson <alexl@redhat.com> | 2004-03-31 09:24:55 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2004-03-31 09:24:55 +0000 |
commit | b3175310b94f6bff55c7946997935b91c9cc93f2 (patch) | |
tree | cc0831b4ce37a2ac39249a275e3e94ad8b91cab9 /src | |
parent | 0ff09bc6fda79f3d6973d44763ade79e948f70d5 (diff) | |
download | nautilus-b3175310b94f6bff55c7946997935b91c9cc93f2.tar.gz |
Based on patch from Soeren Sandmann:
2004-03-31 Alexander Larsson <alexl@redhat.com>
Based on patch from Soeren Sandmann:
* libnautilus-private/nautilus-file.c: (get_description):
Only warn once per mimetype with no description.
* libnautilus-private/nautilus-icon-factory.[ch]:
Add force_size option to force the nominal size.
* src/file-manager/fm-list-model.c:
* src/file-manager/fm-tree-model.c:
Use force_size to avoid constantly scaling things.
Diffstat (limited to 'src')
-rw-r--r-- | src/file-manager/fm-list-model.c | 26 | ||||
-rw-r--r-- | src/file-manager/fm-tree-model.c | 2 |
2 files changed, 6 insertions, 22 deletions
diff --git a/src/file-manager/fm-list-model.c b/src/file-manager/fm-list-model.c index 73c89d743..5bb362e4d 100644 --- a/src/file-manager/fm-list-model.c +++ b/src/file-manager/fm-list-model.c @@ -172,10 +172,9 @@ fm_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int column FMListModel *model; NautilusFile *file; char *str; - GdkPixbuf *icon, *tmp; + GdkPixbuf *icon; int icon_size; NautilusZoomLevel zoom_level; - int width, height; char *modifier; GList *emblem_icons; NautilusFile *parent_file; @@ -229,16 +228,8 @@ fm_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int column modifier = "visiting"; } - icon = nautilus_icon_factory_get_pixbuf_for_file (file, modifier, icon_size); + icon = nautilus_icon_factory_get_pixbuf_for_file_force_size (file, modifier, icon_size); - height = gdk_pixbuf_get_height (icon); - if (height > icon_size) { - width = gdk_pixbuf_get_width (icon) * icon_size / height; - height = icon_size; - tmp = gdk_pixbuf_scale_simple (icon, width, height, GDK_INTERP_BILINEAR); - g_object_unref (icon); - icon = tmp; - } g_value_set_object (value, icon); g_object_unref (icon); break; @@ -265,18 +256,11 @@ fm_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int column if (emblem_icons != NULL) { zoom_level = fm_list_model_get_zoom_level_from_emblem_column_id (column); icon_size = nautilus_get_icon_size_for_zoom_level (zoom_level); - icon = nautilus_icon_factory_get_pixbuf_for_icon (emblem_icons->data, NULL, icon_size, - NULL, NULL, FALSE, NULL); + icon = nautilus_icon_factory_get_pixbuf_for_icon_force_size ( + emblem_icons->data, NULL, icon_size, + NULL, NULL, FALSE, NULL); eel_g_list_free_deep (emblem_icons); - height = gdk_pixbuf_get_height (icon); - if (height > icon_size) { - width = gdk_pixbuf_get_width (icon) * icon_size / height; - height = icon_size; - tmp = gdk_pixbuf_scale_simple (icon, width, height, GDK_INTERP_BILINEAR); - g_object_unref (icon); - icon = tmp; - } g_value_set_object (value, icon); g_object_unref (icon); } diff --git a/src/file-manager/fm-tree-model.c b/src/file-manager/fm-tree-model.c index b3615d915..12e369f76 100644 --- a/src/file-manager/fm-tree-model.c +++ b/src/file-manager/fm-tree-model.c @@ -249,7 +249,7 @@ tree_node_get_pixbuf_from_factory (TreeNode *node, (node->icon_name, NULL, NAUTILUS_ICON_SIZE_FOR_MENUS, NULL); } - return nautilus_icon_factory_get_pixbuf_for_file + return nautilus_icon_factory_get_pixbuf_for_file_force_size (node->file, modifier, NAUTILUS_ICON_SIZE_FOR_MENUS); } |