aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2021-10-27 10:25:18 +0200
committerPetr Mrázek <peterix@gmail.com>2021-10-27 10:25:18 +0200
commit393d17b8d383d7514b45ba980cc0246859bad085 (patch)
treea27ff0d098aab06aac0fa7a08a0d34c180c5daef
parentae4939e0d2e8774b823865cce0a8e822d04673a5 (diff)
downloadPrismLauncher-393d17b8d383d7514b45ba980cc0246859bad085.tar.gz
PrismLauncher-393d17b8d383d7514b45ba980cc0246859bad085.tar.bz2
PrismLauncher-393d17b8d383d7514b45ba980cc0246859bad085.zip
GH-4164 set instance drag image hotspot based on where the drag started
-rw-r--r--launcher/instanceview/InstanceView.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/launcher/instanceview/InstanceView.cpp b/launcher/instanceview/InstanceView.cpp
index a7077d23..80dfb6f2 100644
--- a/launcher/instanceview/InstanceView.cpp
+++ b/launcher/instanceview/InstanceView.cpp
@@ -669,11 +669,10 @@ void InstanceView::startDrag(Qt::DropActions supportedActions)
}
QRect rect;
QPixmap pixmap = renderToPixmap(indexes, &rect);
- //rect.translate(offset());
- // rect.adjust(horizontalOffset(), verticalOffset(), 0, 0);
QDrag *drag = new QDrag(this);
drag->setPixmap(pixmap);
drag->setMimeData(data);
+ drag->setHotSpot(m_pressedPosition - rect.topLeft());
Qt::DropAction defaultDropAction = Qt::IgnoreAction;
if (this->defaultDropAction() != Qt::IgnoreAction && (supportedActions & this->defaultDropAction()))
{