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.
wilder-portage
Kurt Hindenburg 15 years ago
parent ca0cb95007
commit f3c529af6d
  1. 7
      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);
}

Loading…
Cancel
Save