summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <kurt.hindenburg@gmail.com>2011-07-10 02:30:29 (GMT)
committerKurt Hindenburg <kurt.hindenburg@gmail.com>2011-08-25 13:34:37 (GMT)
commit1b2ba0ae777f520e024cce78fc14790d35b1e167 (patch)
tree5323a24493fa4619e6086df7857849e7c16f4ecf
parenteb9691d3f6a324c1801531ff2d3960b3656665fb (diff)
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. (cherry picked from commit f3c529af6d86f607967c89d7f5792472b2f0f755)
-rw-r--r--src/ViewContainer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ViewContainer.cpp b/src/ViewContainer.cpp
index f4a162b..2cbbbf1 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<QAction *> menuActions = _contextPopupMenu->actions();
+ if (_tabBar->count() == 1)
+ menuActions.first()->setEnabled(false);
+ else
+ menuActions.first()->setEnabled(true);
+
_contextPopupMenu->exec(pos);
}