Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Area.py
diff options
context:
space:
mode:
authorManuel Quiñones <manuq@laptop.org>2012-04-26 12:40:07 (GMT)
committer Manuel Quiñones <manuq@laptop.org>2012-04-26 12:40:07 (GMT)
commitec581e4b333dcdc3b24df13c80adb9c913c669da (patch)
treebd0e23546b5f75ba7b96d3b25886878f2f7bce7a /Area.py
parentb705d0594a3cc0f6f805fc03dcedcd87037c453d (diff)
Add cursor for the picker tool #3496
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Diffstat (limited to 'Area.py')
-rw-r--r--Area.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/Area.py b/Area.py
index 24f02d4..aae3d78 100644
--- a/Area.py
+++ b/Area.py
@@ -1403,14 +1403,22 @@ class Area(gtk.DrawingArea):
cursor = gtk.gdk.cursor_new_from_name(display, name)
elif self.tool['name'] == 'marquee-rectangular':
cursor = gtk.gdk.Cursor(gtk.gdk.CROSS)
- elif self.tool['name'] == 'stamp':
- filename = os.path.join('images', 'stamp.png')
- pixbuf = gtk.gdk.pixbuf_new_from_file(filename)
- cursor = gtk.gdk.Cursor(display, pixbuf, 20, 38)
else:
filename = os.path.join('images', self.tool['name'] + '.png')
pixbuf = gtk.gdk.pixbuf_new_from_file(filename)
- cursor = gtk.gdk.Cursor(display, pixbuf, 0, 0)
+
+ # Decide which is the cursor hot spot offset:
+ if self.tool['name'] == 'stamp':
+ hotspot_x, hotspot_y = 20, 38 # horizontal
+ # center and
+ # bottom
+ elif self.tool['name'] == 'picker':
+ hotspot_x, hotspot_y = 1, 38 # bottom left
+ # corner
+ else:
+ hotspot_x, hotspot_y = 0, 0
+
+ cursor = gtk.gdk.Cursor(display, pixbuf, hotspot_x, hotspot_y)
except gobject.GError:
cursor = None
self.window.set_cursor(cursor)