Improved detection of dock widget dragging - uses a distance now (half the height of dock area title bar)

This commit is contained in:
Uwe Kindler
2018-10-15 15:09:59 +02:00
parent ada3d6b3b5
commit 927be9a7d9
7 changed files with 26 additions and 7 deletions

View File

@@ -279,8 +279,10 @@ void CDockWidgetTab::mouseMoveEvent(QMouseEvent* ev)
d->moveTab(ev);
}
bool MouseInsideTitleArea = d->titleAreaGeometryContains(ev->globalPos());
if (!MouseInsideTitleArea)
// Maybe a fixed drag distance is better here ?
int DragDistanceY = qAbs(d->DragStartMousePosition.y() - ev->pos().y());
int MinDragDistanceY = d->DockArea->titleBarGeometry().height() / 2;
if (DragDistanceY >= MinDragDistanceY)
{
// If this is the last dock area in a dock container with only
// one single dock widget it does not make sense to move it to a new