Fixed showing and hiding of dock widget title bar. If a dock widget is the one and only visible widget in a FloatingDockContainer, then this widget does not have a tile bar because the window already has a window frame that provides the same functionality

This commit is contained in:
Uwe Kindler
2018-09-14 13:21:29 +02:00
parent 6ec38b48ef
commit 9f1b2c122a
6 changed files with 139 additions and 31 deletions

View File

@@ -162,14 +162,15 @@ void DockWidgetTabPrivate::moveTab(QMouseEvent* ev)
//============================================================================
bool DockWidgetTabPrivate::startFloating()
{
qDebug() << "isFloating " << DockWidget->dockContainer()->isFloating();
qDebug() << "areaCount " << DockWidget->dockContainer()->dockAreaCount();
auto dockContainer = DockWidget->dockContainer();
qDebug() << "isFloating " << dockContainer->isFloating();
qDebug() << "areaCount " << dockContainer->dockAreaCount();
qDebug() << "widgetCount " << DockWidget->dockAreaWidget()->dockWidgetsCount();
// if this is the last dock widget inside of this floating widget,
// then it does not make any sense, to make it floating because
// it is already floating
if (DockWidget->dockContainer()->isFloating()
&& (DockWidget->dockContainer()->visibleDockAreaCount() == 1)
if (dockContainer->isFloating()
&& (dockContainer->visibleDockAreaCount() == 1)
&& (DockWidget->dockAreaWidget()->dockWidgetsCount() == 1))
{
return false;
@@ -399,6 +400,17 @@ void CDockWidgetTab::mouseDoubleClickEvent(QMouseEvent *event)
Super::mouseDoubleClickEvent(event);
}
//============================================================================
void CDockWidgetTab::setVisible(bool visible)
{
if (!visible)
{
qDebug() << "CDockWidgetTab::setVisible " << visible;
}
Super::setVisible(visible);
}
} // namespace ads
//---------------------------------------------------------------------------