<br><br><div class="gmail_quote">On Wed, May 26, 2010 at 1:42 AM, James Cameron <span dir="ltr"><<a href="mailto:quozl@laptop.org">quozl@laptop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Tue, May 25, 2010 at 06:40:44AM -0300, Gonzalo Odiard wrote:<br>
> Use standard cursors for pencil, brush, eraser and paint-bucket. The<br>
> other tools need a custom cursor.<br>
> Bugs #40, #296 and OLPC #4316, #8864<br>
<br>
</div>Reviewed and tested ...<br>
<br>
1. does fix <a href="http://dev.laptop.org" target="_blank">dev.laptop.org</a> #4316,<br>
<br>
2. doesn't properly fix <a href="http://sugarlabs.org" target="_blank">sugarlabs.org</a> #296, some additional tuning of<br>
coordinates may be needed; drawing effect still appears at an offset,<br>
<br>
3. doesn't fix <a href="http://sugarlabs.org" target="_blank">sugarlabs.org</a> #40, in that the other cursors continue to<br>
be invisible against similar backgrounds,<br>
<br></blockquote><div>Yes, I am redrawing the images for the othr cursors.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
4. doesn't remove images/{pencil,brush,bucket,eraser}.png<br>
</blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The coding style was a bit repetitive, here's an alternate method which<br>
uses a dictionary and wraps the code better:<br>
<br></blockquote><div>Thanks.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
>From e430f2742f910d16a59318060bd39fc80e37822b Mon Sep 17 00:00:00 2001<br>
From: James Cameron <<a href="mailto:quozl@laptop.org">quozl@laptop.org</a>><br>
Date: Wed, 26 May 2010 14:36:13 +1000<br>
Subject: [PATCH] use cursors from Sugar theme<br>
<br>
Use Sugar theme cursors for pencil, brush, eraser and paint-bucket.<br>
<a href="http://dev.laptop.org/ticket/4316" target="_blank">http://dev.laptop.org/ticket/4316</a><br>
---<br>
Area.py | 14 ++++++++++++--<br>
<div class="im"> 1 files changed, 12 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/Area.py b/Area.py<br>
</div>index 611f944..8af2b9b 100644<br>
<div class="im">--- a/Area.py<br>
+++ b/Area.py<br>
</div>@@ -1057,8 +1057,18 @@ class Area(gtk.DrawingArea):<br>
<div class="im"><br>
# Setting the cursor<br>
try:<br>
- pixbuf = gtk.gdk.pixbuf_new_from_file('./images/' + tool['name'] + '.png')<br>
- cursor = gtk.gdk.Cursor(gtk.gdk.display_get_default() , pixbuf, 6, 21)<br>
</div>+ cursors = { 'pencil': 'pencil',<br>
+ 'brush': 'paintbrush',<br>
+ 'eraser': 'eraser',<br>
+ 'bucket': 'paint-bucket' }<br>
+ display = gtk.gdk.display_get_default()<br>
+ if self.tool['name'] in cursors:<br>
+ name = cursors[self.tool['name']]<br>
+ cursor = gtk.gdk.cursor_new_from_name(display, name)<br>
+ else:<br>
+ filename = os.path.join('images', tool['name'] + '.png')<br>
+ pixbuf = gtk.gdk.pixbuf_new_from_file(filename)<br>
+ cursor = gtk.gdk.Cursor(display, pixbuf, 6, 21)<br>
<div class="im"> except gobject.GError:<br>
cursor = None<br>
<br>
</div>--<br>
1.7.1<br>
<br>
<br>
> _______________________________________________<br>
> Sugar-devel mailing list<br>
> <a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
> <a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
<font color="#888888"><br>
<br>
--<br>
James Cameron<br>
<a href="http://quozl.linux.org.au/" target="_blank">http://quozl.linux.org.au/</a><br>
</font></blockquote></div><br><br>