mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-23 21:14:44 +01:00
Use a grab cursor when moving selection rect
This commit is contained in:
parent
7bc70c6221
commit
996a338ed0
1 changed files with 2 additions and 1 deletions
|
|
@ -116,7 +116,7 @@ def get_drag_rect(self):
|
|||
def get_cursor(self):
|
||||
dc = self.selection_state.drag_corner
|
||||
if dc is None:
|
||||
ans = Qt.CrossCursor
|
||||
ans = Qt.OpenHandCursor if self.selection_state.last_drag_pos is None else Qt.ClosedHandCursor
|
||||
elif None in dc:
|
||||
ans = Qt.SizeVerCursor if dc[0] is None else Qt.SizeHorCursor
|
||||
else:
|
||||
|
|
@ -168,6 +168,7 @@ def mousePressEvent(self, ev):
|
|||
if self.selection_state.rect is not None and self.selection_state.rect.contains(pos):
|
||||
self.selection_state.drag_corner = self.selection_state.dragging = self.get_drag_corner(pos)
|
||||
self.selection_state.last_drag_pos = pos
|
||||
self.setCursor(self.get_cursor())
|
||||
else:
|
||||
self.selection_state.current_mode = 'select'
|
||||
self.selection_state.rect = None
|
||||
|
|
|
|||
Loading…
Reference in a new issue