Commit 3d437c06 authored by Czarlie's avatar Czarlie
Browse files

Make stylus cursor only appear on draw area

parent fa0bd803
......@@ -342,6 +342,7 @@ class NoteWindow(Gtk.ApplicationWindow):
self.connect("leave-notify-event", self.on_leave_notify)
self.connect("button-press-event", self.on_button_press_event)
self.textview.connect("scroll-event", self.on_scroll_event)
self.textview.connect("motion-notify-event", self.on_motion_notify)
self.textview.connect("button-press-event", self.on_button_press_event)
global_settings.add_change_listener(
......@@ -514,10 +515,11 @@ class NoteWindow(Gtk.ApplicationWindow):
device.get_source() in DRAWING_INPUT_SOURCES
or device.get_source() in ERASING_INPUT_SOURCES
):
event.get_window().set_device_cursor(
event.get_device(),
Gdk.Cursor.new_from_name(event.get_device().get_display(), "crosshair"),
)
if widget is self.textview:
event.get_window().set_device_cursor(
event.get_device(),
Gdk.Cursor.new_from_name(event.get_device().get_display(), "crosshair"),
)
def on_leave_notify(self, widget, event):
if not self.is_focused:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment