gcmd-devel
[Top][All Lists]
Advanced

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

Re: [gcmd-dev] Fix: device icon size error


From: Piotr Eljasiak
Subject: Re: [gcmd-dev] Fix: device icon size error
Date: Wed, 12 Sep 2007 23:49:53 +0200

> 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
> 

Applied, thanks. Dev icons are scaled to the size stored in
dev_icon_size entry (which defaults to 16) and which is contained in
gcmd's config file. The value can be adjusted to user needs.


Enjoy,
Piotr





reply via email to

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