diff options
author | Manuel 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) |
commit | ec581e4b333dcdc3b24df13c80adb9c913c669da (patch) | |
tree | bd0e23546b5f75ba7b96d3b25886878f2f7bce7a | |
parent | b705d0594a3cc0f6f805fc03dcedcd87037c453d (diff) |
Add cursor for the picker tool #3496
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
-rw-r--r-- | Area.py | 18 | ||||
-rw-r--r-- | images/picker.png | bin | 0 -> 977 bytes |
2 files changed, 13 insertions, 5 deletions
@@ -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) diff --git a/images/picker.png b/images/picker.png Binary files differnew file mode 100644 index 0000000..9ca1eeb --- /dev/null +++ b/images/picker.png |