diff --git a/src/ViewContainer.cpp b/src/ViewContainer.cpp index f4a162bf..2cbbbf1b 100644 --- a/src/ViewContainer.cpp +++ b/src/ViewContainer.cpp @@ -665,6 +665,13 @@ void TabbedViewContainer::openTabContextMenu(int index, const QPoint& pos) { _contextMenuTabIndex = index; + // Enable 'Detach Tab' menu item only if there is more than 1 tab + QList menuActions = _contextPopupMenu->actions(); + if (_tabBar->count() == 1) + menuActions.first()->setEnabled(false); + else + menuActions.first()->setEnabled(true); + _contextPopupMenu->exec(pos); }