diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2023-01-26 19:58:04 +0100 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2023-01-27 12:34:29 +0000 |
commit | 39434062a2f7174f7d7ba400d32ee841e1208d63 (patch) | |
tree | 72492df079129d323012f73b553fa11d7df4f6ea /src/plugins/coreplugin/mainwindow.cpp | |
parent | 87d3056a15345f48a5e4f6d996e084140e1c58ad (diff) |
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>
Diffstat (limited to 'src/plugins/coreplugin/mainwindow.cpp')
-rw-r--r-- | src/plugins/coreplugin/mainwindow.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 4950eb909b..4e9449e4bf 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -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 |