aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEike Ziller <[email protected]>2022-07-04 14:20:52 +0200
committerEike Ziller <[email protected]>2022-07-05 09:08:40 +0000
commit4d72cb55ba1e692767ae48b3592436a8df78668c (patch)
tree0a93e5db925fafb2f2d7ddffa20806b623c92bbf /src
parent53269fc3868b73cf9d0fa4a557d9b6aa0fdd7e06 (diff)
Projects mode: Use "Show Right Sidebar" action to toggle build output
For users who want the full area for the configuration widgets or don't see output there because their build system doesn't put it there. Fixes: QTCREATORBUG-26069 Change-Id: I4ffa73be88e5c7cc058227bc681f87e4c0a642bd Reviewed-by: Alessandro Portale <[email protected]> Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/projectexplorer/projectwindow.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp
index ebf6f59f78b..d360ec33277 100644
--- a/src/plugins/projectexplorer/projectwindow.cpp
+++ b/src/plugins/projectexplorer/projectwindow.cpp
@@ -635,8 +635,28 @@ public:
outputLayout->addWidget(m_buildSystemOutput->toolBar());
outputLayout->addWidget(m_buildSystemOutput);
outputLayout->addWidget(new FindToolBarPlaceHolder(m_buildSystemOutput));
- auto outputDock = q->addDockForWidget(output, true);
- q->addDockWidget(Qt::RightDockWidgetArea, outputDock);
+ m_outputDock = q->addDockForWidget(output, true);
+ q->addDockWidget(Qt::RightDockWidgetArea, m_outputDock);
+
+ m_toggleRightSidebarAction.setCheckable(true);
+ m_toggleRightSidebarAction.setChecked(true);
+ const auto toolTipText = [](bool checked) {
+ return checked
+ ? QCoreApplication::translate("Core", Core::Constants::TR_HIDE_RIGHT_SIDEBAR)
+ : QCoreApplication::translate("Core", Core::Constants::TR_SHOW_RIGHT_SIDEBAR);
+ };
+ m_toggleRightSidebarAction.setText(toolTipText(false)); // always "Show Right Sidebar"
+ m_toggleRightSidebarAction.setToolTip(toolTipText(m_toggleRightSidebarAction.isChecked()));
+ ActionManager::registerAction(&m_toggleRightSidebarAction,
+ Core::Constants::TOGGLE_RIGHT_SIDEBAR,
+ Context(Constants::C_PROJECTEXPLORER));
+ connect(&m_toggleRightSidebarAction,
+ &QAction::toggled,
+ this,
+ [this, toolTipText](bool checked) {
+ m_toggleRightSidebarAction.setToolTip(toolTipText(checked));
+ m_outputDock->setVisible(checked);
+ });
}
void updatePanel()
@@ -805,6 +825,8 @@ public:
SelectorTree *m_selectorTree;
QPushButton *m_importBuild;
QPushButton *m_manageKits;
+ QAction m_toggleRightSidebarAction;
+ QDockWidget *m_outputDock;
BuildSystemOutputWindow *m_buildSystemOutput;
};
@@ -866,6 +888,7 @@ void ProjectWindow::loadPersistentSettings()
settings->beginGroup(PROJECT_WINDOW_KEY);
restoreSettings(settings);
settings->endGroup();
+ d->m_toggleRightSidebarAction.setChecked(d->m_outputDock->isVisible());
}
QSize SelectorDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const