From f3c529af6d86f607967c89d7f5792472b2f0f755 Mon Sep 17 00:00:00 2001 From: Kurt Hindenburg Date: Sat, 9 Jul 2011 22:30:29 -0400 Subject: [PATCH] Only enable the tab popup menu 'Detach Tab' for > 1 tabs. Currently you can Detach Tab if that tab is the only one; that makes no sense and has no use. --- src/ViewContainer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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); }