Repository: napari/napari

Issue:
error when clicking in layers list
## 🐛 Bug

program crashes when i click in the layers list

## To Reproduce

Steps to reproduce the behavior:

1. open any example
2. click in the layers list

```python
WARNING: Traceback (most recent call last):
  File "/Users/kiraevans/Projects/napari/napari/components/_layers_list/view/main.py", line 115, in mouseMoveEvent
    distance = (event.pos() - self.drag_start_position).manhattanLength()
TypeError: unsupported operand type(s) for -: 'QPoint' and 'tuple'
```

## Expected behavior

it doesnt crash

## Environment

 - napari Version (e.g., 1.0): master
 - OS (e.g., Linux): OSX
 - Python version: 3.7
 - Any other relevant information:

`conda list | grep qt` output:
```
pyqt                      5.9.2            py37h655552a_2
pyqt5                     5.12.1                   pypi_0    pypi
pyqt5-sip                 4.19.15                  pypi_0    pypi
qt                        5.9.7                h468cd18_1
qtawesome                 0.5.7                    pypi_0    pypi
qtconsole                 4.4.3                    pypi_0    pypi
qtpy                      1.7.0                    pypi_0    pypi
sphinxcontrib-qthelp      1.0.2                    pypi_0    pypi
```


Discussion:

Resolving patch:
diff --git a/napari/components/_layers_list/view/main.py b/napari/components/_layers_list/view/main.py
--- a/napari/components/_layers_list/view/main.py
+++ b/napari/components/_layers_list/view/main.py
@@ -10,6 +10,7 @@
     QApplication,
 )
 from qtpy.QtGui import QDrag
+import numpy as np
 
 
 class QtLayersList(QScrollArea):
@@ -33,7 +34,7 @@ def __init__(self, layers):
         self.layers.events.removed.connect(self._remove)
         self.layers.events.reordered.connect(self._reorder)
 
-        self.drag_start_position = (0, 0)
+        self.drag_start_position = np.zeros(2)
         self.drag_name = None
 
     def _add(self, event):
@@ -90,7 +91,9 @@ def mousePressEvent(self, event):
         )
 
         if layer is not None:
-            self.drag_start_position = event.pos()
+            self.drag_start_position = np.array(
+                [event.pos().x(), event.pos().y()]
+            )
             self.drag_name = layer.name
         else:
             self.drag_name = None
@@ -124,8 +127,12 @@ def mouseReleaseEvent(self, event):
             layer.selected = True
 
     def mouseMoveEvent(self, event):
-        distance = (event.pos() - self.drag_start_position).manhattanLength()
-        if distance < QApplication.startDragDistance():
+        position = np.array([event.pos().x(), event.pos().y()])
+        distance = np.linalg.norm(position - self.drag_start_position)
+        if (
+            distance < QApplication.startDragDistance()
+            or self.drag_name is None
+        ):
             return
         mimeData = QMimeData()
         mimeData.setText(self.drag_name)
@@ -141,14 +148,17 @@ def dragLeaveEvent(self, event):
             self.vbox_layout.itemAt(i).widget().setSelected(False)
 
     def dragEnterEvent(self, event):
-        divs = []
-        for i in range(0, self.vbox_layout.count(), 2):
-            widget = self.vbox_layout.itemAt(i).widget()
-            divs.append(widget.y() + widget.frameGeometry().height() / 2)
-        self.centers = [
-            (divs[i + 1] + divs[i]) / 2 for i in range(len(divs) - 1)
-        ]
-        event.accept()
+        if event.source() == self:
+            event.accept()
+            divs = []
+            for i in range(0, self.vbox_layout.count(), 2):
+                widget = self.vbox_layout.itemAt(i).widget()
+                divs.append(widget.y() + widget.frameGeometry().height() / 2)
+            self.centers = [
+                (divs[i + 1] + divs[i]) / 2 for i in range(len(divs) - 1)
+            ]
+        else:
+            event.ignore()
 
     def dragMoveEvent(self, event):
         """Set the appropriate layers list divider to be highlighted when


Test patch: