Add option to hide tools

This allows hiding the tools menu by default.
Power users can enable it again.

Change-Id: I5465f0c525bb5b4954e13cb42a941ac8b6b7cf37
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Thomas Hartmann
2023-01-26 19:58:04 +01:00
parent 87d3056a15
commit 39434062a2
4 changed files with 28 additions and 3 deletions

View File

@@ -112,6 +112,10 @@ static const char openFromDeviceDialogKey[] = "OpenFromDeviceDialog";
static const bool askBeforeExitDefault = false;
static bool hideToolsMenu()
{
return Core::ICore::settings()->value(Constants::SETTINGS_MENU_HIDE_TOOLS, false).toBool();
}
enum { debugMainWindow = 0 };
@@ -498,7 +502,10 @@ void MainWindow::registerDefaultContainers()
// Tools Menu
ActionContainer *ac = ActionManager::createMenu(Constants::M_TOOLS);
menubar->addMenu(ac, Constants::G_TOOLS);
ac->setParent(this);
if (!hideToolsMenu())
menubar->addMenu(ac, Constants::G_TOOLS);
ac->menu()->setTitle(tr("&Tools"));
// Window Menu