[sugar] Icon(gtk.Image) - icon size

Simon Schampijer simon
Mon Mar 17 05:58:57 EDT 2008


Hi,

I found out what one of my problems was. For the SugarIcon I tried to 
set a pixel_size. 
http://www.pygtk.org/pygtk2reference/class-gtkimage.html#method-gtkimage--set-pixel-size

Giving a pixel_size works when handing it directly to the constructor 
but not when changing the properties of an existing object 
(icon.props.pixel_size = style.XLARGE_ICON_SIZE).

The attached patch does fix this. I think the _update_buffer_size() 
method is not used anywhere so we can remove it I guess. Marco, Tomeu 
what do you think?

Simon



Simon Schampijer wrote:
> Hi,
> 
> the Icon class (derived from gtk.Image) is using gtk-icon-size-lookup[1] 
> to determine the icon's size. The size must therefore be an enum like 
> gtk.ICON_SIZE_MENU.
> 
> How do we best handle our custom sizes (like style.LARGE_ICON_SIZE)? 
> You can registers a new icon size [2] but I am not sure this is the 
> right approach.
> 
> Best,
>     Simon
> 
> [1] 
> http://www.pygtk.org/pygtk2reference/class-gtkiconsource.html#function-gtk--icon-size-lookup
> [2]
> http://www.pygtk.org/pygtk2reference/class-gtkiconsource.html#function-gtk--icon-size-register
> _______________________________________________
> Sugar mailing list
> Sugar at lists.laptop.org
> http://lists.laptop.org/listinfo/sugar

-------------- next part --------------
A non-text attachment was scrubbed...
Name: update_icon_pixel_size.patch
Type: text/x-patch
Size: 1168 bytes
Desc: not available
Url : http://lists.laptop.org/pipermail/sugar/attachments/20080317/e42b37c2/attachment.bin 



More information about the Sugar-devel mailing list