summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-file.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-10-10 19:35:21 +0200
committerStefano Karapetsas <[email protected]>2012-10-10 19:35:21 +0200
commit2bad19e7888648507079d10340a01a4aa6b24e12 (patch)
tree22453cdf20872ce3e3eb3db54d1dbe3642205d3c /libcaja-private/caja-file.c
parent2fbc016ecf597878e7a650db8f80ed91a49176b8 (diff)
downloadcaja-2bad19e7888648507079d10340a01a4aa6b24e12.tar.bz2
caja-2bad19e7888648507079d10340a01a4aa6b24e12.tar.xz
refactor thumbnails codemate-file-manager-1.5.0
Diffstat (limited to 'libcaja-private/caja-file.c')
-rw-r--r--libcaja-private/caja-file.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c
index 2227ac2c..31863c9c 100644
--- a/libcaja-private/caja-file.c
+++ b/libcaja-private/caja-file.c
@@ -43,6 +43,7 @@
#include "caja-search-directory.h"
#include "caja-search-directory-file.h"
#include "caja-thumbnails.h"
+#include "caja-ui-utilities.h"
#include "caja-users-groups-cache.h"
#include "caja-vfs-file.h"
#include "caja-saved-search-file.h"
@@ -2791,7 +2792,7 @@ compare_files_by_size (CajaFile *file_1, CajaFile *file_2)
*/
Knowledge size_known_1, size_known_2;
- goffset size_1, size_2;
+ goffset size_1 = 0, size_2 = 0;
size_known_1 = get_size (file_1, &size_1);
size_known_2 = get_size (file_2, &size_2);
@@ -4267,8 +4268,20 @@ caja_file_get_icon (CajaFile *file,
gicon = get_custom_icon (file);
if (gicon) {
+ GdkPixbuf *pixbuf;
+
icon = caja_icon_info_lookup (gicon, size);
g_object_unref (gicon);
+
+ pixbuf = caja_icon_info_get_pixbuf (icon);
+ if (pixbuf != NULL) {
+ caja_ui_frame_image (&pixbuf);
+ g_object_unref (icon);
+
+ icon = caja_icon_info_new_for_pixbuf (pixbuf);
+ g_object_unref (pixbuf);
+ }
+
return icon;
}
@@ -4302,13 +4315,11 @@ caja_file_get_icon (CajaFile *file,
}
scaled_pixbuf = gdk_pixbuf_scale_simple (raw_pixbuf,
- w * scale, h * scale,
+ MAX (w * scale, 1),
+ MAX (h * scale, 1),
GDK_INTERP_BILINEAR);
- /* We don't want frames around small icons */
- if (!gdk_pixbuf_get_has_alpha(raw_pixbuf) || s >= 128) {
- caja_thumbnail_frame_image (&scaled_pixbuf);
- }
+ caja_ui_frame_image (&scaled_pixbuf);
g_object_unref (raw_pixbuf);
/* Don't scale up if more than 25%, then read the original