Merge branch '1.2'

This commit is contained in:
Sergio Martins
2020-12-19 14:12:10 +00:00
4 changed files with 70 additions and 6 deletions

View File

@@ -132,6 +132,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)
@@ -516,6 +517,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
@@ -795,6 +801,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