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

Manuel Kaufmann humitos at gmail.com
Mon Apr 30 16:16:59 EDT 2012


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)
-- 
1.7.10



More information about the Sugar-devel mailing list