refactor: Center drag point for screen management

This commit is contained in:
sithlord48
2025-11-01 08:40:01 -04:00
committed by Chris Rizzitello
parent 50240c1fc3
commit acd4b59b4c
2 changed files with 2 additions and 2 deletions

View File

@ -34,6 +34,6 @@ void NewScreenWidget::mousePressEvent(QMouseEvent *event)
auto *pDrag = new QDrag(this);
pDrag->setMimeData(pMimeData);
pDrag->setPixmap(pixmap());
pDrag->setHotSpot(event->pos());
pDrag->setHotSpot(QPoint(width() / 2, height() / 2));
pDrag->exec(Qt::CopyAction, Qt::CopyAction);
}

View File

@ -129,7 +129,7 @@ void ScreenSetupView::startDrag(Qt::DropActions)
auto *pDrag = new QDrag(this);
pDrag->setPixmap(pixmap);
pDrag->setMimeData(pData);
pDrag->setHotSpot(QPoint(pixmap.width() / 2, pixmap.height() / 2));
pDrag->setHotSpot(QPoint(iconSize().width() / 2, iconSize().height() / 2));
if (pDrag->exec(Qt::MoveAction, Qt::MoveAction) == Qt::MoveAction) {
selectionModel()->clear();