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

Tomeu Vizoso tomeu at tomeuvizoso.net
Mon Mar 17 09:52:14 EDT 2008


On Mon, Mar 17, 2008 at 10:58 AM, Simon Schampijer <simon at schampijer.de> wrote:
> 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?

Sounds good to me.

Tomeu

>  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


More information about the Sugar mailing list