diff -uNr --exclude='*.o' rox-2.1.2/ROX-Filer/src/global.h rox-2.1.3/ROX-Filer/src/global.h --- rox-2.1.2/ROX-Filer/src/global.h 2004-03-07 17:45:20.000000000 +0200 +++ rox-2.1.3/ROX-Filer/src/global.h 2004-05-18 11:59:44.000000000 +0300 @@ -150,6 +150,7 @@ #define ROX_STOCK_SELECT "rox-select" #define ROX_STOCK_MOUNT "rox-mount" #define ROX_STOCK_MOUNTED "rox-mounted" +#define ROX_STOCK_SYMLINK "symlink" #define ROX_STOCK_BOOKMARKS GTK_STOCK_JUMP_TO #include diff -uNr --exclude='*.o' rox-2.1.2/ROX-Filer/src/pixmaps.c rox-2.1.3/ROX-Filer/src/pixmaps.c --- rox-2.1.2/ROX-Filer/src/pixmaps.c 2004-05-18 12:31:21.000000000 +0300 +++ rox-2.1.3/ROX-Filer/src/pixmaps.c 2004-05-18 12:27:54.000000000 +0300 @@ -101,9 +101,11 @@ ROX_STOCK_SELECT, ROX_STOCK_MOUNT, ROX_STOCK_MOUNTED, + ROX_STOCK_SYMLINK, }; static GtkIconSize mount_icon_size = -1; +static GtkIconSize symlink_icon_size = -1; /* Static prototypes */ @@ -162,8 +164,9 @@ } gtk_icon_factory_add_default(factory); - mount_icon_size = gtk_icon_size_register("rox-mount-size", 14, 14); - + mount_icon_size = gtk_icon_size_register("rox-mount-size", 14, 14); + symlink_icon_size = gtk_icon_size_register("rox-symlink-size", 10, 10); + load_default_pixmaps(); option_register_widget("thumbs-purge-cache", thumbs_purge_cache); @@ -207,7 +210,7 @@ size, NULL, NULL); - retval = masked_pixmap_new(pixbuf); + retval = masked_pixmap_new_no_scale(pixbuf); gdk_pixbuf_unref(pixbuf); return retval; @@ -644,6 +647,7 @@ return image; } +#if 0 /* Scale src down to fit in max_w, max_h and return the new pixbuf. * If src is small enough, then ref it and return that. */ @@ -673,6 +677,30 @@ GDK_INTERP_BILINEAR); } } +#endif +/* Scale src to fit in max_w, max_h as close as possible + * and return the new pixbuf. + */ +GdkPixbuf *scale_pixbuf(GdkPixbuf *src, int max_w, int max_h) +{ + int w, h; + + w = gdk_pixbuf_get_width(src); + h = gdk_pixbuf_get_height(src); + float scale_x = ((float) w) / max_w; + float scale_y = ((float) h) / max_h; + float scale = MAX(scale_x, scale_y); + int dest_w = w / scale; + int dest_h = h / scale; + + return gdk_pixbuf_scale_simple(src, + MAX(dest_w, 1), + MAX(dest_h, 1), + GDK_INTERP_BILINEAR); + +} + + /* Scale src up to fit in max_w, max_h and return the new pixbuf. * If src is that size or bigger, then ref it and return that. @@ -855,6 +883,30 @@ return mp; } +MaskedPixmap *masked_pixmap_new_no_scale(GdkPixbuf *full_size) +{ + MaskedPixmap *mp; + GdkPixbuf *src_pixbuf, *normal_pixbuf; + + g_return_val_if_fail(full_size != NULL, NULL); + + src_pixbuf = full_size; + gdk_pixbuf_ref(full_size); + normal_pixbuf = full_size; + gdk_pixbuf_ref(full_size); + + mp = g_object_new(masked_pixmap_get_type(), NULL); + + mp->src_pixbuf = src_pixbuf; + + mp->pixbuf = normal_pixbuf; + mp->pixbuf_lit = create_spotlight_pixbuf(normal_pixbuf, 0x000099, 128); + mp->width = gdk_pixbuf_get_width(normal_pixbuf); + mp->height = gdk_pixbuf_get_height(normal_pixbuf); + + return mp; +} + /* Stolen from eel...and modified to colourize the pixbuf. * 'alpha' is the transparency of 'color' (0xRRGGBB): * 0 = fully opaque, 255 = fully transparent. @@ -927,10 +979,11 @@ GTK_ICON_SIZE_DIALOG); im_unknown = mp_from_stock(GTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG); - im_symlink = load_pixmap("symlink"); + im_unmounted = mp_from_stock(ROX_STOCK_MOUNT, mount_icon_size); im_mounted = mp_from_stock(ROX_STOCK_MOUNTED, mount_icon_size); + im_symlink = mp_from_stock(ROX_STOCK_SYMLINK, symlink_icon_size); im_appdir = load_pixmap("application"); im_dirs = load_pixmap("dirs"); diff -uNr --exclude='*.o' rox-2.1.2/ROX-Filer/src/pixmaps.h rox-2.1.3/ROX-Filer/src/pixmaps.h --- rox-2.1.2/ROX-Filer/src/pixmaps.h 2004-05-18 12:31:21.000000000 +0300 +++ rox-2.1.3/ROX-Filer/src/pixmaps.h 2004-05-18 12:12:39.000000000 +0300 @@ -75,6 +75,7 @@ MaskedPixmap *load_pixmap(const char *name); void pixmap_background_thumb(const gchar *path, GFunc callback, gpointer data); MaskedPixmap *masked_pixmap_new(GdkPixbuf *full_size); +MaskedPixmap *masked_pixmap_new_no_scale(GdkPixbuf *full_size); GdkPixbuf *scale_pixbuf(GdkPixbuf *src, int max_w, int max_h); MaskedPixmap *pixmap_combine(MaskedPixmap *im_base, MaskedPixmap *im_emblem); #endif /* _PIXMAP_H */