@@ -431,6 +431,24 @@ void CDockAreaTitleBar::onCloseButtonClicked()
431431}
432432
433433
434+ // ============================================================================
435+ void CDockAreaTitleBar::onAutoHideCloseActionTriggered ()
436+ {
437+ d->DockArea ->closeArea ();
438+ }
439+
440+
441+ // ============================================================================
442+ void CDockAreaTitleBar::onAutoHideMinimizeActionTriggered ()
443+ {
444+ auto AutoHideContainer = d->DockArea ->autoHideDockContainer ();
445+ if (AutoHideContainer)
446+ {
447+ AutoHideContainer->collapseView (true );
448+ }
449+ }
450+
451+
434452// ============================================================================
435453void CDockAreaTitleBar::onUndockButtonClicked ()
436454{
@@ -735,7 +753,17 @@ void CDockAreaTitleBar::contextMenuEvent(QContextMenuEvent* ev)
735753 }
736754 Menu.addSeparator ();
737755 }
738- Action = Menu.addAction (isAutoHide ? tr (" Close" ) : tr (" Close Group" ), this , SLOT (onCloseButtonClicked ()));
756+
757+ if (isAutoHide)
758+ {
759+ Action = Menu.addAction (tr (" Minimize" ), this , SLOT (onAutoHideMinimizeActionTriggered ()));
760+ Action = Menu.addAction (tr (" Close" ), this , SLOT (onAutoHideCloseActionTriggered ()));
761+ }
762+ else
763+ {
764+ Action = Menu.addAction (isAutoHide ? tr (" Close" ) : tr (" Close Group" ), this , SLOT (onCloseButtonClicked ()));
765+ }
766+
739767 Action->setEnabled (d->DockArea ->features ().testFlag (CDockWidget::DockWidgetClosable));
740768 if (!isAutoHide && !isTopLevelArea)
741769 {
@@ -782,7 +810,8 @@ QString CDockAreaTitleBar::titleBarButtonToolTip(TitleBarButton Button) const
782810 case TitleBarButtonClose:
783811 if (d->DockArea ->isAutoHide ())
784812 {
785- return tr (" Close" );
813+ bool Minimize = CDockManager::testAutoHideConfigFlag (CDockManager::AutoHideCloseButtonCollapsesDock);
814+ return Minimize ? tr (" Minimize" ) : tr (" Close" );
786815 }
787816
788817 if (CDockManager::testConfigFlag (CDockManager::DockAreaCloseButtonClosesTab))
0 commit comments