diff --git a/.github/workflows/linux-builds.yml b/.github/workflows/linux-builds.yml index f3e2492..9a80bd9 100644 --- a/.github/workflows/linux-builds.yml +++ b/.github/workflows/linux-builds.yml @@ -6,7 +6,7 @@ jobs: build: strategy: matrix: - os: [ubuntu-latest, ubuntu-20.04, ubuntu-18.04] + os: [ubuntu-20.04, ubuntu-18.04] runs-on: ${{ matrix.os }} diff --git a/src/AutoHideDockContainer.cpp b/src/AutoHideDockContainer.cpp index d86e7cf..3762eec 100644 --- a/src/AutoHideDockContainer.cpp +++ b/src/AutoHideDockContainer.cpp @@ -187,14 +187,7 @@ AutoHideDockContainerPrivate::AutoHideDockContainerPrivate( //============================================================================ CDockContainerWidget* CAutoHideDockContainer::dockContainer() const { - if (d->DockArea) - { - return d->DockArea->dockContainer(); - } - else - { - return internal::findParent(this); - } + return internal::findParent(this); } @@ -303,8 +296,15 @@ CAutoHideDockContainer::~CAutoHideDockContainer() //============================================================================ CAutoHideSideBar* CAutoHideDockContainer::sideBar() const { - auto DockContainer = dockContainer(); - return DockContainer ? DockContainer->sideTabBar(d->SideTabBarArea) : nullptr; + if (d->SideTab) + { + return d->SideTab->sideBar(); + } + else + { + auto DockContainer = dockContainer(); + return DockContainer ? DockContainer->sideTabBar(d->SideTabBarArea) : nullptr; + } } diff --git a/src/AutoHideSideBar.cpp b/src/AutoHideSideBar.cpp index 6a1ebe2..c64b079 100644 --- a/src/AutoHideSideBar.cpp +++ b/src/AutoHideSideBar.cpp @@ -378,11 +378,19 @@ int CAutoHideSideBar::spacing() const return d->TabsLayout->spacing(); } + //=========================================================================== void CAutoHideSideBar::setSpacing(int Spacing) { d->TabsLayout->setSpacing(Spacing); } + +//=========================================================================== +CDockContainerWidget* CAutoHideSideBar::dockContainer() const +{ + return d->ContainerWidget; +} + } // namespace ads diff --git a/src/AutoHideSideBar.h b/src/AutoHideSideBar.h index 6ec816a..3575357 100644 --- a/src/AutoHideSideBar.h +++ b/src/AutoHideSideBar.h @@ -163,6 +163,11 @@ public: * Setter for spacing property - sets the spacing */ void setSpacing(int Spacing); + + /** + * Returns the dock container that hosts this sideBar() + */ + CDockContainerWidget* dockContainer() const; }; } // namespace ads //----------------------------------------------------------------------------- diff --git a/src/DockWidget.cpp b/src/DockWidget.cpp index e519880..569f77b 100644 --- a/src/DockWidget.cpp +++ b/src/DockWidget.cpp @@ -248,17 +248,31 @@ void DockWidgetPrivate::updateParentDockArea() //============================================================================ void DockWidgetPrivate::closeAutoHideDockWidgetsIfNeeded() { - if (_this->dockContainer() && _this->dockContainer()->openedDockWidgets().isEmpty() && !_this->dockManager()->isRestoringState()) + auto DockContainer = _this->dockContainer(); + if (!DockContainer) { - for (auto autoHideWidget : _this->dockContainer()->autoHideWidgets()) - { - if (autoHideWidget->dockWidget() == _this) - { - continue; - } + return; + } - autoHideWidget->dockWidget()->toggleView(false); - } + if (_this->dockManager()->isRestoringState()) + { + return; + } + + if (!DockContainer->openedDockWidgets().isEmpty()) + { + return; + } + + for (auto autoHideWidget : DockContainer->autoHideWidgets()) + { + auto DockWidget = autoHideWidget->dockWidget(); + if (DockWidget == _this) + { + continue; + } + + DockWidget->toggleView(false); } }