[Sugar-devel] [PATCH sugar 1/7] SugarEventIcon: Add a hippo-free implementation of the CanvasIcon

Simon Schampijer simon at schampijer.de
Mon Aug 6 09:44:42 EDT 2012


On 08/06/2012 02:02 PM, Benjamin Berg wrote:
> Hi,
>
> On Mon, 2012-08-06 at 12:04 +0200, Simon Schampijer wrote:
>> Signed-off-by: Simon Schampijer <simon at laptop.org>
>> [moved from sugar-toolkit to sugar]
>> Signed-off-by: Sascha Silbe <silbe at activitycentral.com>
> Reviewed-by: Benjamin Berg <benzea at sugarlabs.org>
>
>> +    def __init__(self, **kwargs):
>> +        self._buffer = _IconBuffer()
>> +        self._alpha = 1.0
>> +
>> +        gtk.EventBox.__init__(self)
>> +        for key, value in kwargs.iteritems():
>> +            self.set_property(key, value)
>> +
>> +        self._palette_invoker = CursorInvoker()
>> +        self._palette_invoker.attach(self)
>> +
>> +        # HACK to supress the grey background around the icon
>> +        # won't be needed in GTK3
>> +        self.modify_bg(gtk.STATE_NORMAL, style.COLOR_WHITE.get_gdk_color())
>
> Not really too bad, but I am pretty sure that
> gtk.EventBox.set_visible_window(False) should work fine here.
>
>

Hmm, there is something I do not understand yet. If I set the 
visible_window to False the container can not handle the allocation 
anymore correctly and position the icons over each other - the (x,y) 
values are not handled anymore correctly, the icon itself is drawn, even 
without background.

I just tried it with a little test program with a custom container and 
with Gtk.Fixed with the same result for both.

Regards,
    Simon



More information about the Sugar-devel mailing list