@@ -431,6 +431,24 @@ void CDockAreaTitleBar::onCloseButtonClicked()
431
431
}
432
432
433
433
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
+
434
452
// ============================================================================
435
453
void CDockAreaTitleBar::onUndockButtonClicked ()
436
454
{
@@ -735,7 +753,17 @@ void CDockAreaTitleBar::contextMenuEvent(QContextMenuEvent* ev)
735
753
}
736
754
Menu.addSeparator ();
737
755
}
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
+
739
767
Action->setEnabled (d->DockArea ->features ().testFlag (CDockWidget::DockWidgetClosable));
740
768
if (!isAutoHide && !isTopLevelArea)
741
769
{
@@ -782,7 +810,8 @@ QString CDockAreaTitleBar::titleBarButtonToolTip(TitleBarButton Button) const
782
810
case TitleBarButtonClose:
783
811
if (d->DockArea ->isAutoHide ())
784
812
{
785
- return tr (" Close" );
813
+ bool Minimize = CDockManager::testAutoHideConfigFlag (CDockManager::AutoHideCloseButtonCollapsesDock);
814
+ return Minimize ? tr (" Minimize" ) : tr (" Close" );
786
815
}
787
816
788
817
if (CDockManager::testConfigFlag (CDockManager::DockAreaCloseButtonClosesTab))
0 commit comments