Create auto hide sidebars only if config flag is set

This commit is contained in:
Uwe Kindler 2022-11-01 11:22:15 +01:00
parent 44790307d8
commit fba9c7ce5d
4 changed files with 8 additions and 15 deletions

View File

@ -262,7 +262,6 @@ void CAutoHideDockContainer::updateSize()
//============================================================================
CAutoHideDockContainer::~CAutoHideDockContainer()
{
qDebug() << "~CAutoHideDockContainer()"
ADS_PRINT("~CAutoHideDockContainer");
// Remove event filter in case there are any queued messages
@ -417,11 +416,6 @@ void CAutoHideDockContainer::collapseView(bool Enable)
show();
d->DockWidget->dockManager()->setDockWidgetFocused(d->DockWidget);
qApp->installEventFilter(this);
qDebug() << "CAutoHideDockContainer.hidden " << this->isHidden();
qDebug() << "d->DockArea->isHidden() " << d->DockArea->isHidden();
qDebug() << "d->DockWidget->isHidden() " << d->DockWidget->isHidden();
qDebug() << "CAutoHideDockContainer.geometry() " << this->geometry();
}
ADS_PRINT("CAutoHideDockContainer::collapseView " << Enable);

View File

@ -502,7 +502,6 @@ void CDockAreaWidget::insertDockWidget(int index, CDockWidget* DockWidget,
//============================================================================
void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
{
qDebug() << "CDockAreaWidget::removeDockWidget";
ADS_PRINT("CDockAreaWidget::removeDockWidget");
auto CurrentDockWidget = currentDockWidget();
auto NextOpenDockWidget = (DockWidget == CurrentDockWidget) ? nextOpenDockWidget(DockWidget) : nullptr;

View File

@ -846,7 +846,6 @@ void DockContainerWidgetPrivate::addDockAreasToList(const QList<CDockAreaWidget*
//============================================================================
void DockContainerWidgetPrivate::appendDockAreas(const QList<CDockAreaWidget*> NewDockAreas)
{
qDebug() << "DockContainerWidgetPrivate::appendDockAreas";
DockAreas.append(NewDockAreas);
for (auto DockArea : NewDockAreas)
{
@ -1326,13 +1325,11 @@ CDockContainerWidget::CDockContainerWidget(CDockManager* DockManager, QWidget *p
{
d->DockManager->registerDockContainer(this);
createRootSplitter();
if (CDockManager::testConfigFlag(CDockManager::AutoHideFeatureEnabled))
{
createSideTabBarWidgets();
}
createSideTabBarWidgets();
}
}
//============================================================================
CDockContainerWidget::~CDockContainerWidget()
{
@ -1566,7 +1563,6 @@ void CDockContainerWidget::addDockArea(CDockAreaWidget* DockAreaWidget,
//============================================================================
void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
{
qDebug() << "CDockContainerWidget::removeDockArea " << d->DockAreas.contains(area);
ADS_PRINT("CDockContainerWidget::removeDockArea");
// If it is an auto hide area, then there is nothing much to do
if (area->isAutoHide())
@ -1779,7 +1775,6 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
void CDockContainerWidget::dropWidget(QWidget* Widget, DockWidgetArea DropArea, CDockAreaWidget* TargetAreaWidget)
{
CDockWidget* SingleDockWidget = topLevelDockWidget();
qDebug() << "CDockContainerWidget::dropWidget";
if (TargetAreaWidget)
{
d->moveToNewSection(Widget, TargetAreaWidget, DropArea);
@ -1956,6 +1951,11 @@ void CDockContainerWidget::createRootSplitter()
//============================================================================
void CDockContainerWidget::createSideTabBarWidgets()
{
if (!CDockManager::testConfigFlag(CDockManager::AutoHideFeatureEnabled))
{
return;
}
{
auto Area = SideBarLocation::Left;
d->SideTabBarWidgets[Area] = new CSideTabBar(this, Area);

View File

@ -117,6 +117,7 @@ CSideTabBar::CSideTabBar(CDockContainerWidget* parent, SideBarLocation area) :
CSideTabBar::~CSideTabBar()
{
qDebug() << "~CSideTabBar() ";
qDebug() << "parent " << d->ContainerWidget;
// The SideTabeBar is not the owner of the tabs and to prevent deletion
// we set the parent here to nullptr to remove it from the children
auto Tabs = findChildren<CDockWidgetSideTab*>(QString(), Qt::FindDirectChildrenOnly);
@ -161,7 +162,6 @@ void CSideTabBar::removeDockWidget(CDockWidget* DockWidget)
//============================================================================
void CSideTabBar::removeSideTab(CDockWidgetSideTab* SideTab)
{
qDebug() << "CSideTabBar::removeSideTab " << SideTab->text();
SideTab->removeEventFilter(this);
d->TabsLayout->removeWidget(SideTab);
if (d->TabsLayout->isEmpty())