Save the last overlayed size
We might want to restore it
This commit is contained in:
@@ -133,6 +133,7 @@ public:
|
||||
bool m_updatingToggleAction = false;
|
||||
bool m_updatingFloatAction = false;
|
||||
bool m_isForceClosing = false;
|
||||
QSize m_lastOverlayedSize = QSize(0, 0);
|
||||
};
|
||||
|
||||
DockWidgetBase::DockWidgetBase(const QString &name, Options options)
|
||||
@@ -517,6 +518,11 @@ bool DockWidgetBase::hasPreviousDockedLocation() const
|
||||
return d->m_lastPositions.isValid();
|
||||
}
|
||||
|
||||
QSize DockWidgetBase::lastOverlayedSize() const
|
||||
{
|
||||
return d->m_lastOverlayedSize;
|
||||
}
|
||||
|
||||
FloatingWindow *DockWidgetBase::morphIntoFloatingWindow()
|
||||
{
|
||||
qCDebug(creation) << "DockWidget::morphIntoFloatingWindow() this=" << this
|
||||
@@ -796,6 +802,19 @@ void DockWidgetBase::onHidden(bool spontaneous)
|
||||
}
|
||||
}
|
||||
|
||||
bool DockWidgetBase::onResize(QSize newSize)
|
||||
{
|
||||
if (isOverlayed()) {
|
||||
if (auto frame = this->frame()) {
|
||||
d->m_lastOverlayedSize = frame->QWidgetAdapter::size();
|
||||
} else {
|
||||
qWarning() << Q_FUNC_INFO << "Overlayed dock widget without frame shouldn't happen";
|
||||
}
|
||||
}
|
||||
|
||||
return QWidgetAdapter::onResize(newSize);
|
||||
}
|
||||
|
||||
void DockWidgetBase::onCloseEvent(QCloseEvent *e)
|
||||
{
|
||||
e->accept(); // By default we accept, means DockWidget closes
|
||||
|
||||
Reference in New Issue
Block a user