Cleanup of cursor setup

This commit is contained in:
itdominator 2023-05-30 16:54:21 -05:00
parent 630a140d2f
commit f10c6d9afd
1 changed files with 7 additions and 6 deletions

View File

@ -47,9 +47,7 @@ class ImageViewEveBox(Gtk.EventBox):
self.add(ImageView())
def _press_event(self, widget = None, eve = None):
window = settings.get_main_window()
cursor = Gdk.Cursor(Gdk.CursorType.CROSSHAIR)
window.get_window().set_cursor(cursor)
self.set_cursor(Gdk.CursorType.CROSSHAIR)
self._is_dragging = True
self._drag_start_x = eve.x_root
@ -81,10 +79,13 @@ class ImageViewEveBox(Gtk.EventBox):
def _release_event(self, widget = None, eve = None):
window = settings.get_main_window()
watch_cursor = Gdk.Cursor(Gdk.CursorType.ARROW)
window.get_window().set_cursor(watch_cursor)
self.set_cursor(Gdk.CursorType.ARROW)
self._is_dragging = False
self._drag_start_x = 0
self._drag_start_y = 0
def set_cursor(self, type = None):
window = settings.get_main_window()
cursor = Gdk.Cursor(type)
window.get_window().set_cursor(cursor)