aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-01-27 14:30:42 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-01-27 14:30:42 +0800
commit803fc4da6978b404212cf233ad7dec740a1c6bd0 (patch)
treefb88e73f29742672dfff7060b23b5f235efa7f51 /shell
parent38b37faf3692af41fff269e14514e3d34da86f0a (diff)
downloadgsoc2013-evolution-803fc4da6978b404212cf233ad7dec740a1c6bd0.tar
gsoc2013-evolution-803fc4da6978b404212cf233ad7dec740a1c6bd0.tar.gz
gsoc2013-evolution-803fc4da6978b404212cf233ad7dec740a1c6bd0.tar.bz2
gsoc2013-evolution-803fc4da6978b404212cf233ad7dec740a1c6bd0.tar.lz
gsoc2013-evolution-803fc4da6978b404212cf233ad7dec740a1c6bd0.tar.xz
gsoc2013-evolution-803fc4da6978b404212cf233ad7dec740a1c6bd0.tar.zst
gsoc2013-evolution-803fc4da6978b404212cf233ad7dec740a1c6bd0.zip
Fix the folder tree so that the icons don't look blurry anymore. (For
some reason, the `gdk_pixbuf_scale()' function seems to give me a modified copy of the image even for a 1.0 scaling factor.) svn path=/trunk/; revision=7848
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog6
-rw-r--r--shell/e-storage-set-view.c33
2 files changed, 26 insertions, 13 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index f18c26ab4f..6ed321d8a1 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,9 @@
+2001-01-27 Ettore Perazzoli <ettore@ximian.com>
+
+ * e-storage-set-view.c (get_pixbuf_for_folder): Don't scale if the
+ size is the same. `gdk_pixbuf_scale()' seems to be blurring the
+ image even if the scaling factor is 1.0.
+
2001-01-26 Ettore Perazzoli <ettore@ximian.com>
* e-corba-storage.c: Remove all instances of `__FUNCTION__'.
diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c
index 32c55b279a..ef76d21903 100644
--- a/shell/e-storage-set-view.c
+++ b/shell/e-storage-set-view.c
@@ -190,6 +190,7 @@ get_pixbuf_for_folder (EStorageSetView *storage_set_view,
EFolderTypeRegistry *folder_type_registry;
EStorageSet *storage_set;
GdkPixbuf *icon_pixbuf;
+ int icon_pixbuf_width, icon_pixbuf_height;
storage_set = priv->storage_set;
folder_type_registry = e_storage_set_get_folder_type_registry (storage_set);
@@ -197,21 +198,27 @@ get_pixbuf_for_folder (EStorageSetView *storage_set_view,
icon_pixbuf = e_folder_type_registry_get_icon_for_type (folder_type_registry,
type_name, TRUE);
- if (icon_pixbuf == NULL) {
+ if (icon_pixbuf == NULL)
return NULL;
- }
- scaled_pixbuf = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (icon_pixbuf),
- gdk_pixbuf_get_has_alpha (icon_pixbuf),
- gdk_pixbuf_get_bits_per_sample (icon_pixbuf),
- E_SHELL_MINI_ICON_SIZE, E_SHELL_MINI_ICON_SIZE);
-
- gdk_pixbuf_scale (icon_pixbuf, scaled_pixbuf,
- 0, 0, E_SHELL_MINI_ICON_SIZE, E_SHELL_MINI_ICON_SIZE,
- 0.0, 0.0,
- (double) E_SHELL_MINI_ICON_SIZE / gdk_pixbuf_get_width (icon_pixbuf),
- (double) E_SHELL_MINI_ICON_SIZE / gdk_pixbuf_get_height (icon_pixbuf),
- GDK_INTERP_HYPER);
+ icon_pixbuf_width = gdk_pixbuf_get_width (icon_pixbuf);
+ icon_pixbuf_height = gdk_pixbuf_get_height (icon_pixbuf);
+
+ if (icon_pixbuf_width == E_SHELL_MINI_ICON_SIZE && icon_pixbuf_height == E_SHELL_MINI_ICON_SIZE) {
+ scaled_pixbuf = gdk_pixbuf_ref (icon_pixbuf);
+ } else {
+ scaled_pixbuf = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (icon_pixbuf),
+ gdk_pixbuf_get_has_alpha (icon_pixbuf),
+ gdk_pixbuf_get_bits_per_sample (icon_pixbuf),
+ E_SHELL_MINI_ICON_SIZE, E_SHELL_MINI_ICON_SIZE);
+
+ gdk_pixbuf_scale (icon_pixbuf, scaled_pixbuf,
+ 0, 0, E_SHELL_MINI_ICON_SIZE, E_SHELL_MINI_ICON_SIZE,
+ 0.0, 0.0,
+ (double) E_SHELL_MINI_ICON_SIZE / gdk_pixbuf_get_width (icon_pixbuf),
+ (double) E_SHELL_MINI_ICON_SIZE / gdk_pixbuf_get_height (icon_pixbuf),
+ GDK_INTERP_HYPER);
+ }
g_hash_table_insert (priv->type_name_to_pixbuf, g_strdup(type_name), scaled_pixbuf);
}