From f5ac29c19e7ff0a912d40b7a1ef4ef7d1e635d6f Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Wed, 26 Oct 2022 15:06:23 +0200 Subject: [PATCH] Implemented support for Opaque / Non Opaque auto hide container resizing --- demo/MainWindow.cpp | 2 +- src/AutoHideDockContainer.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/demo/MainWindow.cpp b/demo/MainWindow.cpp index 8275456..285b26c 100644 --- a/demo/MainWindow.cpp +++ b/demo/MainWindow.cpp @@ -616,7 +616,7 @@ CMainWindow::CMainWindow(QWidget *parent) : // uncomment the following line if you want to use opaque undocking and // opaque splitter resizing - // CDockManager::setConfigFlags(CDockManager::DefaultOpaqueConfig); + //CDockManager::setConfigFlags(CDockManager::DefaultOpaqueConfig); // uncomment the following line if you want a fixed tab width that does // not change if the visibility of the close button changes diff --git a/src/AutoHideDockContainer.cpp b/src/AutoHideDockContainer.cpp index 7692ea0..de41960 100644 --- a/src/AutoHideDockContainer.cpp +++ b/src/AutoHideDockContainer.cpp @@ -94,6 +94,10 @@ int resizeHandleLayoutPosition(CDockWidgetSideTab::SideTabBarArea Area) return 0; } + +/** + * Private data of CAutoHideDockContainer - pimpl + */ struct AutoHideDockContainerPrivate { CAutoHideDockContainer* _this; @@ -126,6 +130,9 @@ struct AutoHideDockContainerPrivate return LeftDockWidgetArea; } + /** + * Update the resize limit of the resize handle + */ void updateResizeHandleSizeLimitMax() { auto Rect = _this->parentContainer()->contentRect(); @@ -182,6 +189,8 @@ CAutoHideDockContainer::CAutoHideDockContainer(CDockManager* DockManager, CDockW d->Layout->addWidget(d->DockArea); d->ResizeHandle = new CResizeHandle(edgeFromSideTabBarArea(area), this); d->ResizeHandle->setMinResizeSize(64); + bool OpaqueResize = CDockManager::testConfigFlag(CDockManager::OpaqueSplitterResize); + d->ResizeHandle->setOpaqueResize(OpaqueResize); d->Layout->insertWidget(resizeHandleLayoutPosition(area), d->ResizeHandle); d->Size = d->DockArea->size();