FancyMainWindow: Add an option to hide the central widget

This way the debugger views can take up the whole window, which is
useful for the QML and perf profilers.

Change-Id: Ia4d236e8738a666d2316c05edaf4cf48ac46ffdb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Ulf Hermann
2016-09-07 18:14:04 +02:00
parent 9cde684eea
commit b604b8fc2b
3 changed files with 30 additions and 1 deletions

View File

@@ -184,7 +184,12 @@ void DebuggerMainWindow::finalizeSetup()
Context debugcontext(Debugger::Constants::C_DEBUGMODE);
ActionContainer *viewsMenu = ActionManager::actionContainer(Core::Constants::M_WINDOW_VIEWS);
Command *cmd = ActionManager::registerAction(menuSeparator1(),
Command *cmd = ActionManager::registerAction(showCentralWidgetAction(),
"Debugger.Views.ShowCentralWidget", debugcontext);
cmd->setAttribute(Command::CA_Hide);
cmd->setAttribute(Command::CA_UpdateText);
viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
cmd = ActionManager::registerAction(menuSeparator1(),
"Debugger.Views.Separator1", debugcontext);
cmd->setAttribute(Command::CA_Hide);
viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
@@ -349,10 +354,14 @@ void DebuggerMainWindow::loadPerspectiveHelper(const QByteArray &perspectiveId,
if (settings->value(QLatin1String("ToolSettingsSaved"), false).toBool())
restoreSettings(settings);
settings->endGroup();
} else {
// By default, show the central widget
showCentralWidgetAction()->setChecked(true);
}
QWidget *central = perspective->centralWidget();
m_centralWidgetStack->addWidget(central ? central : m_editorPlaceHolder);
showCentralWidgetAction()->setText(central ? central->windowTitle() : tr("Editor"));
QTC_CHECK(m_toolbarForPerspectiveId.contains(m_currentPerspectiveId));
m_controlsStackWidget->setCurrentWidget(m_toolbarForPerspectiveId.value(m_currentPerspectiveId));