From 302ee59d679c868e47d2bd604744433994878571 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Fri, 9 Dec 2022 08:50:12 +0100 Subject: [PATCH 1/3] Fixed dockContainer() function of AutoHideDockContainer.cpp Returning the dock container of the internal dock area is wrong, if the dock widget is removed from the AutoHideDockContainer, then the DockArea container function already returns the new dock container of the DockArea and not the dock container of the AutoHideDockContainer.cpp --- src/AutoHideDockContainer.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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; + } } From 2cd451c53c2f45159f9108d988e5bec1dc9de4d1 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Fri, 9 Dec 2022 08:50:41 +0100 Subject: [PATCH 2/3] Added dockContainer() function to AutoHideSideBar.cpp --- src/AutoHideSideBar.cpp | 8 ++++++++ src/AutoHideSideBar.h | 5 +++++ src/DockWidget.cpp | 32 +++++++++++++++++++++++--------- 3 files changed, 36 insertions(+), 9 deletions(-) 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); } } From 9f5e06ae1316524a034f9991bc9a2ab4ee957283 Mon Sep 17 00:00:00 2001 From: githubuser0xFFFF Date: Fri, 9 Dec 2022 15:04:03 +0100 Subject: [PATCH 3/3] Update linux-builds.yml Removed ubuntu-latest because there seems to be build issues for ubuntu-22.04 --- .github/workflows/linux-builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }}