[Sugar-devel] [PATCH Paint] Keep flood fill cursor after clicks SL #3491

Manuel Quiñones manuq at laptop.org
Mon Apr 30 16:53:35 EDT 2012


2012/4/30 Manuel Kaufmann <humitos at gmail.com>:
> When the user selects the Paint Bucket tool and clicks on the canvas, the bucket
> cursor is kept until the user selects another tool.
>
> Signed-off-by: Manuel Kaufmann <humitos at gmail.com>
> ---
>  Area.py |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/Area.py b/Area.py
> index aae3d78..50c0744 100644
> --- a/Area.py
> +++ b/Area.py
> @@ -670,7 +670,9 @@ class Area(gtk.DrawingArea):
>         fill(self.pixmap, self.gc, x, y, width,
>                 height, self.gc_line.foreground.pixel)
>         widget.queue_draw()
> -        self.window.set_cursor(None)
> +        display = gtk.gdk.display_get_default()
> +        cursor = gtk.gdk.cursor_new_from_name(display, 'paint-bucket')
> +        self.window.set_cursor(cursor)
>
>     def flood_fill(self, x, y, fill_color):
>         width, height = self.window.get_size()
> @@ -707,7 +709,10 @@ class Area(gtk.DrawingArea):
>
>         self.pixmap.draw_image(self.gc, gdk_image, 0, 0, 0, 0, width, height)
>         self.queue_draw()
> -        self.window.set_cursor(None)
> +
> +        display = gtk.gdk.display_get_default()
> +        cursor = gtk.gdk.cursor_new_from_name(display, 'paint-bucket')
> +        self.window.set_cursor(cursor)
>
>     def pick_color(self, x, y):
>         gdk_image = self.pixmap.get_image(x, y, 1, 1)

Thanks, pushed as ac25ef327ad2ca416ec4824be72dd29a8287968b .

However, this shows that Paint needs a bit of refactoring :)


-- 
.. manuq ..


More information about the Sugar-devel mailing list