[Sugar-devel] [PATCH sugar-toolkit-gtk3 (shell-port)] The icon consists of an GtkEventBox and an IconBuffer. The GtkEventBox is a subclass of GtkBin which has its own window and therefor is used to catch events for our IconBuffer which does not have it's own window.

Simon Schampijer simon at schampijer.de
Tue Aug 7 05:16:40 EDT 2012


On 07/03/2012 08:05 PM, Benjamin Berg wrote:
> On Fri, 2012-06-22 at 16:08 +0200, Simon Schampijer wrote:
>> The EventIcon does emit the 'activated' signal when clicked
>> and uses the CursorInvoker to invoke a palette the same
>> way as the CanvasIcon did.
>>
>> We keep the same API as with the CanvasIcon, only the 'size'
>> property is changed to be called 'pixel_size' in order to
>> make clearer which values it expects to be passed. We don't
>> expect a GtkIconSize to be passed here.
>>
>> Another option would have been to put a SugarIcon inside a
>> a GtkEventBox and make the properties available through an
>> icon property but the API would have not been as nice and
>> logically it seems to make more sense to have the IconBuffer
>> being the base for both the SugarIcon and the SugarEventIcon.
>>
>> This patch has ben developed based on the one that is
>> proposed for the toolkit-gtk2.
>
> The patch looks good.
>
>> Signed-off-by: Simon Schampijer <simon at laptop.org>
> Reviewd-by: Benjamin Berg <benzea at sugarlabs.org>
>
>
>

Thanks for the review, pushed that one after polishing the description.

http://git.sugarlabs.org/sugar-toolkit-gtk3/sugar-toolkit-gtk3/commit/6438c89dea729fbca08e33f6b0175e85b1c72795

Note, that in GTK+ 3 we do not need to take allocation.x/y and in the 
drawing into account as we had to do with the GTK+ 2 version.

Simon


More information about the Sugar-devel mailing list