diff --git a/src/DockAreaTitleBar.cpp b/src/DockAreaTitleBar.cpp index df2c66a..34ef197 100644 --- a/src/DockAreaTitleBar.cpp +++ b/src/DockAreaTitleBar.cpp @@ -488,7 +488,10 @@ void CDockAreaTitleBar::onCurrentTabChanged(int Index) //============================================================================ void CDockAreaTitleBar::onAutoHideButtonClicked(bool Checked) { - d->DockArea->toggleAutoHideArea(Checked); + if (d->DockArea->features().testFlag(CDockWidget::DockWidgetPinnable)) + { + d->DockArea->toggleAutoHideArea(Checked); + } } diff --git a/src/DockAreaWidget.cpp b/src/DockAreaWidget.cpp index 526e7ee..d8e95ad 100644 --- a/src/DockAreaWidget.cpp +++ b/src/DockAreaWidget.cpp @@ -363,6 +363,8 @@ void DockAreaWidgetPrivate::updateTitleBarButtonStates() _this->features().testFlag(CDockWidget::DockWidgetClosable)); TitleBar->button(TitleBarButtonUndock)->setEnabled( _this->features().testFlag(CDockWidget::DockWidgetFloatable)); + TitleBar->button(TitleBarButtonAutoHide)->setEnabled( + _this->features().testFlag(CDockWidget::DockWidgetPinnable)); TitleBar->updateDockWidgetActionsButtons(); UpdateTitleBarButtons = false; } diff --git a/src/DockManager.cpp b/src/DockManager.cpp index 1b0c5da..843402b 100644 --- a/src/DockManager.cpp +++ b/src/DockManager.cpp @@ -1065,6 +1065,7 @@ CDockAreaWidget* CDockManager::setCentralWidget(CDockWidget* widget) widget->setFeature(CDockWidget::DockWidgetClosable, false); widget->setFeature(CDockWidget::DockWidgetMovable, false); widget->setFeature(CDockWidget::DockWidgetFloatable, false); + widget->setFeature(CDockWidget::DockWidgetPinnable, false); d->CentralWidget = widget; CDockAreaWidget* CentralArea = addDockWidget(CenterDockWidgetArea, widget); CentralArea->setDockAreaFlag(CDockAreaWidget::eDockAreaFlag::HideSingleWidgetTitleBar, true); diff --git a/src/DockWidget.h b/src/DockWidget.h index 5fa176f..373f068 100644 --- a/src/DockWidget.h +++ b/src/DockWidget.h @@ -159,7 +159,8 @@ public: DockWidgetForceCloseWithArea = 0x040, ///< dock widget will be closed when the dock area hosting it is closed NoTab = 0x080, ///< dock widget tab will never be shown if this flag is set DeleteContentOnClose = 0x100, ///< deletes only the contained widget on close, keeping the dock widget intact and in place. Attempts to rebuild the contents widget on show if there is a widget factory set. - DefaultDockWidgetFeatures = DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable | DockWidgetFocusable, + DockWidgetPinnable = 0x200, ///< dock widget can be pinned and added to an overlay widget + DefaultDockWidgetFeatures = DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable | DockWidgetFocusable | DockWidgetPinnable, AllDockWidgetFeatures = DefaultDockWidgetFeatures | DockWidgetDeleteOnClose | CustomCloseHandling, DockWidgetAlwaysCloseAndDelete = DockWidgetForceCloseWithArea | DockWidgetDeleteOnClose, NoDockWidgetFeatures = 0x000