gcmd-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gcmd-dev] Fix: device icon size error


From: Mike Crash
Subject: [gcmd-dev] Fix: device icon size error
Date: Mon, 20 Aug 2007 22:34:11 +0200
User-agent: Icedove 1.5.0.10 (X11/20070328)

Pixmaps for devices are loaded in default size, so it is mismatched to the Home and SMB icons. Mostly it displays all images too large, so it should be resized to 16x16. This change will do it.

To file gnome-cmd-pixmap.cc add this function:

GnomeCmdPixmap *
gnome_cmd_pixmap_new_from_file_size (const gchar *filepath, int width, int height)
{
   //FIXME: Handle GError here
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file_at_size (filepath, width, height, NULL);
   if (pixbuf)
       return gnome_cmd_pixmap_new_from_pixbuf (pixbuf);

   return NULL;
}

Don't forget to update the gnome-cmd-pixmap.h too.

Then change in file gnome-cmd-con-device.cc in function gnome_cmd_con_device_set_icon_path line 498 loading of images to

con->go_pixmap = gnome_cmd_pixmap_new_from_file_size (icon_path, 16, 16);
con->open_pixmap = gnome_cmd_pixmap_new_from_file_size (icon_path, 16, 16);

Tested and works well.

Mike





reply via email to

[Prev in Thread] Current Thread [Next in Thread]