change cursor for drawing modes

This commit is contained in:
Josh Holtrop 2011-07-27 22:26:09 -04:00
parent cd1deb3c8b
commit 895fa54ed7

View File

@ -20,6 +20,10 @@ class SketchWidget:
self.drawingConstraints = [] self.drawingConstraints = []
self.mode = '' self.mode = ''
self.snap_points = {} # keyed by (shape, ptNum) self.snap_points = {} # keyed by (shape, ptNum)
self.cursors = {
'arrow': gtk.gdk.Cursor(gtk.gdk.ARROW),
'crosshair': gtk.gdk.Cursor(gtk.gdk.CROSSHAIR),
}
# Configuration parameters # Configuration parameters
self.line_width = 1.5 self.line_width = 1.5
@ -357,6 +361,11 @@ class SketchWidget:
elif self.mode == 'circle': elif self.mode == 'circle':
self.drawingShape = None self.drawingShape = None
self.queue_redraw() self.queue_redraw()
if self.widget.window is not None:
if mode in ('line', 'circle'):
self.widget.window.set_cursor(self.cursors['crosshair'])
else:
self.widget.window.set_cursor(self.cursors['arrow'])
self.mode = mode self.mode = mode
def do_line_left_click(self, x, y): def do_line_left_click(self, x, y):