[Sugar-devel] [PATCH sugar-toolkit (shell-port)] SugarEventIcon: Port the CanvasIcon to a hippo-free implementation

Benjamin Berg benzea at sugarlabs.org
Tue Jul 3 14:04:43 EDT 2012

On Fri, 2012-06-22 at 15:58 +0200, Simon Schampijer wrote:
> 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.
> The EventIcon does emit the 'activated' signal when clicked
> and uses the CursorInvoker to invoke a palette the same
> way as the CanvasIcon did. The CursorInvoker had to be adopted
> accordingly and made it hippo free as well.
> 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.
> There are a few unnecessary docstrings removed from the
> icon class.
> This patch is highly based on the work from Walter Bender,
> Daniel Drake and Raul Gutierrez Segales.
> Signed-off-by: Simon Schampijer <simon at laptop.org>

Reviewd-by: Benjamin Berg <benzea at sugarlabs.org>

OK, just one small comment.

> +        # 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())

GTK+ 2.x also knows about invisible windows, so you can use exactly the
same API here.
Note: Also remove the import of style if this is removed.


More information about the Sugar-devel mailing list