Take window frame into account when dragging dock widget
Dock widgets with custom titlebar are frameless by default, so this isn't usually a problem. However, the user can override the default and make it non-frameless (by just removing the native title bar, not the frame). Task-number: QTBUG-58843 Change-Id: Iff7a2a719cb2f326f2f81bbfb1b53ba01a63f3e1 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
cd2b5f1ada
commit
99ce1d3d97
@ -930,7 +930,9 @@ bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event)
|
||||
}
|
||||
|
||||
if (state->dragging && !state->nca) {
|
||||
QPoint pos = event->globalPos() - state->pressPos;
|
||||
QMargins windowMargins = q->window()->windowHandle()->frameMargins();
|
||||
QPoint windowMarginOffset = QPoint(windowMargins.left(), windowMargins.top());
|
||||
QPoint pos = event->globalPos() - state->pressPos - windowMarginOffset;
|
||||
|
||||
QDockWidgetGroupWindow *floatingTab = qobject_cast<QDockWidgetGroupWindow*>(parent);
|
||||
if (floatingTab && !q->isFloating())
|
||||
|
Loading…
x
Reference in New Issue
Block a user