mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Drag 'n drop: Dont start drag if any keyboard modifiers are pressed
This commit is contained in:
parent
8854982f14
commit
588ce1adb8
@ -500,11 +500,13 @@ class BooksView(QTableView): # {{{
|
||||
return QTableView.mousePressEvent(self, event)
|
||||
|
||||
def mouseMoveEvent(self, event):
|
||||
if not (event.buttons() & Qt.LeftButton) or self.drag_start_pos is None:
|
||||
return
|
||||
if (event.pos() - self.drag_start_pos).manhattanLength() \
|
||||
< QApplication.startDragDistance():
|
||||
return
|
||||
if not (event.buttons() & Qt.LeftButton) or \
|
||||
self.drag_start_pos is None or \
|
||||
QApplication.keyboardModifiers() != Qt.NoModifier or \
|
||||
(event.pos() - self.drag_start_pos).manhattanLength() \
|
||||
< QApplication.startDragDistance():
|
||||
return QTableView.mouseMoveEvent(self, event)
|
||||
|
||||
index = self.indexAt(event.pos())
|
||||
if not index.isValid():
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user