summaryrefslogtreecommitdiff
path: root/src/modlistview.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2021-01-07 21:46:58 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-01-10 10:27:30 +0100
commit7d9fa5e4f96840321ff996b4c637b7cd686c3570 (patch)
treed078e7264f80edafe0e05360edaa3fb6d79a990f /src/modlistview.cpp
parentfc60ea5b7a023493375a6fced6572156f48e36c3 (diff)
Fix drop below collapsed separator.
Diffstat (limited to 'src/modlistview.cpp')
-rw-r--r--src/modlistview.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/modlistview.cpp b/src/modlistview.cpp
index ec31d4dc..91d522a6 100644
--- a/src/modlistview.cpp
+++ b/src/modlistview.cpp
@@ -1295,10 +1295,18 @@ void ModListView::dragMoveEvent(QDragMoveEvent* event)
void ModListView::dropEvent(QDropEvent* event)
{
+ // from Qt source
+ QModelIndex index;
+ if (viewport()->rect().contains(event->pos())) {
+ index = indexAt(event->pos());
+ if (!index.isValid() || !visualRect(index).contains(event->pos()))
+ index = QModelIndex();
+ }
+
// this event is used by the byPriorityProxy to know if allow
// dropping mod between a separator and its first mod (there
// is no way to deduce this except using dropIndicatorPosition())
- emit dropEntered(event->mimeData(), static_cast<DropPosition>(dropIndicatorPosition()));
+ emit dropEntered(event->mimeData(), isExpanded(index), static_cast<DropPosition>(dropIndicatorPosition()));
// see selectedIndexes()
m_inDragMoveEvent = true;