MDI: Fix docked widget geometries not being remembered when floating

We shouldn't move the Frame directly. Instead, do it through the
layout, which will then remember the last docked geometry
This commit is contained in:
Sergio Martins
2021-03-07 16:56:37 +00:00
parent 9fe11a7ad5
commit 446560931b
10 changed files with 148 additions and 24 deletions

View File

@@ -20,6 +20,7 @@
#include "Utils_p.h"
#include "WidgetResizeHandler_p.h"
#include "Config.h"
#include "MDILayoutWidget_p.h"
#include <QMouseEvent>
#include <QGuiApplication>
@@ -445,7 +446,9 @@ bool StateInternalMDIDragging::handleMouseMove(QPoint globalPos)
newLocalPosBounded.setX(qMin(newLocalPosBounded.x(), parentSize.width() - frame->width()));
newLocalPosBounded.setY(qMin(newLocalPosBounded.y(), parentSize.height() - frame->height()));
frame->QWidgetAdapter::move(newLocalPosBounded);
auto layout = frame->mdiLayoutWidget();
Q_ASSERT(layout);
layout->move(frame, newLocalPosBounded);
// Check if we need to pop out the MDI window (make it float)
// If we drag the window against an edge, and move behind the edge some threshold, we float it