diff --git a/artiq/gui/dndwidgets.py b/artiq/gui/dndwidgets.py index 401981e78..1024e97f0 100644 --- a/artiq/gui/dndwidgets.py +++ b/artiq/gui/dndwidgets.py @@ -21,6 +21,25 @@ class DragDropSplitter(QtWidgets.QSplitter): def dragMoveEvent(self, e): pos = e.pos() + src = e.source() + src_i = self.indexOf(src) + + # case 0: smaller than source widget + if pos.y() < src.y(): + for n in range(src_i): + w = self.widget(n) + if pos.y() < w.y() + w.size().height(): + self.setRubberBand(w.y()) + break + # case 2: greater than source widget + elif pos.y() > src.y() + src.size().height(): + for n in range(src_i): + w = self.widget(n) + if pos.y() < w.y() + w.size().height(): + self.setRubberBand(w.y()) + break + else: + self.setRubberBand(-1) for n in range(self.count()): w = self.widget(n) if self.orientation() == QtCore.Qt.Vertical: