From 7ed3f8b2d1cc804bcd80349ffb2f446704b0bd30 Mon Sep 17 00:00:00 2001 From: Syarif Fakhri Date: Wed, 19 Oct 2022 17:30:08 +0800 Subject: [PATCH] Remove all dock widget focusable constraint on auto hide button --- src/DockAreaWidget.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/DockAreaWidget.cpp b/src/DockAreaWidget.cpp index f23138f..e59f57e 100644 --- a/src/DockAreaWidget.cpp +++ b/src/DockAreaWidget.cpp @@ -315,11 +315,6 @@ struct DockAreaWidgetPrivate */ void updateTitleBarButtonVisibility(bool isTopLevel); - /** - * Convenience function to know if all dock widgets are focusable - */ - bool allDockWidgetsFocusable() const; - /** * Scans all contained dock widgets for the max. minimum size hint */ @@ -387,7 +382,7 @@ void DockAreaWidgetPrivate::updateTitleBarButtonVisibility(bool IsTopLevel) if (IsTopLevel) { TitleBar->button(TitleBarButtonClose)->setVisible(!container->isFloating()); - TitleBar->button(TitleBarButtonAutoHide)->setVisible(!container->isFloating() && allDockWidgetsFocusable()); + TitleBar->button(TitleBarButtonAutoHide)->setVisible(!container->isFloating()); // Undock and tabs should never show when auto hidden TitleBar->button(TitleBarButtonUndock)->setVisible(!container->isFloating() && !_this->isAutoHide()); TitleBar->button(TitleBarButtonTabsMenu)->setVisible(!_this->isAutoHide()); @@ -395,25 +390,12 @@ void DockAreaWidgetPrivate::updateTitleBarButtonVisibility(bool IsTopLevel) else { TitleBar->button(TitleBarButtonClose)->setVisible(true); - TitleBar->button(TitleBarButtonAutoHide)->setVisible(allDockWidgetsFocusable()); + TitleBar->button(TitleBarButtonAutoHide)->setVisible(true); TitleBar->button(TitleBarButtonUndock)->setVisible(!_this->isAutoHide()); TitleBar->button(TitleBarButtonTabsMenu)->setVisible(!_this->isAutoHide()); } } -bool DockAreaWidgetPrivate::allDockWidgetsFocusable() const -{ - for (const auto &dockWidget : _this->dockWidgets()) - { - if (!dockWidget->features().testFlag(CDockWidget::DockWidgetFocusable)) - { - return false; - } - } - - return true; -} - //============================================================================ CDockAreaWidget::CDockAreaWidget(CDockManager* DockManager, CDockContainerWidget* parent) :