Fixed handling of dock area removal in floating dock container, added close-button.svg icon to enable display of disabled close button

This commit is contained in:
Uwe Kindler
2018-10-31 00:50:18 +01:00
parent 6617cf6f19
commit 1dfabb3bef
6 changed files with 321 additions and 22 deletions

View File

@@ -460,19 +460,7 @@ void CFloatingDockContainer::moveFloating()
//============================================================================
bool CFloatingDockContainer::isClosable() const
{
auto OpenDockAreas = d->DockContainer->openedDockAreas();
for (auto DockArea : OpenDockAreas)
{
auto OpenDockWidgets = DockArea->openedDockWidgets();
for (auto DockWidget : OpenDockWidgets)
{
if (!DockWidget->features().testFlag(CDockWidget::DockWidgetClosable))
{
return false;
}
}
}
return true;
return d->DockContainer->features().testFlag(CDockWidget::DockWidgetClosable);
}
@@ -482,7 +470,7 @@ void CFloatingDockContainer::onDockAreasAddedOrRemoved()
qDebug() << "CFloatingDockContainer::onDockAreasAddedOrRemoved()";
if (d->DockContainer->visibleDockAreaCount() == 1)
{
d->SingleDockArea = topLevelDockWidget()->dockAreaWidget();
d->SingleDockArea = d->DockContainer->openedDockAreas()[0];
this->setWindowTitle(d->SingleDockArea->currentDockWidget()->windowTitle());
connect(d->SingleDockArea, SIGNAL(currentChanged(int)), this,
SLOT(onDockAreaCurrentChanged(int)));