File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 5050#include " FloatingDockContainer.h"
5151#include " DockOverlay.h"
5252#include " DockManager.h"
53- #include " IconProvider.h"
5453#include " DockFocusController.h"
5554
5655
@@ -540,13 +539,14 @@ QMenu* CDockWidgetTab::buildContextMenu(QMenu *Menu)
540539 Menu = new QMenu (this );
541540 }
542541
542+ qDebug () << " CDockWidgetTab::buildContextMenu" ;
543543 const bool isFloatable = d->DockWidget ->features ().testFlag (CDockWidget::DockWidgetFloatable);
544- const bool isNotOnlyTabInContainer = !d->DockArea ->dockContainer ()->hasTopLevelDockWidget ();
545544 const bool isTopLevelArea = d->DockArea ->isTopLevelArea ();
546- const bool isDetachable = isFloatable && isNotOnlyTabInContainer;
545+ const bool isFloating = d->DockWidget ->isFloating ();
546+ const bool isDetachable = isFloatable && !isFloating;
547547 QAction* Action;
548548
549- if (!isTopLevelArea)
549+ if (!( isTopLevelArea && isFloating) )
550550 {
551551 Action = Menu->addAction (tr (" Detach" ), this , SLOT (detachDockWidget ()));
552552 Action->setEnabled (isDetachable);
@@ -570,7 +570,7 @@ QMenu* CDockWidgetTab::buildContextMenu(QMenu *Menu)
570570 Action->setEnabled (isClosable ());
571571 if (d->DockArea ->openDockWidgetsCount () > 1 )
572572 {
573- Action = Menu->addAction (tr (" Close Others" ), this , SIGNAL (closeOtherTabsRequested ()));
573+ Menu->addAction (tr (" Close Others" ), this , SIGNAL (closeOtherTabsRequested ()));
574574 }
575575
576576 return Menu;
You can’t perform that action at this time.
0 commit comments