diff --git a/src/plugins/coreplugin/messageoutputwindow.cpp b/src/plugins/coreplugin/messageoutputwindow.cpp index ef84b100ab1..d02157e5557 100644 --- a/src/plugins/coreplugin/messageoutputwindow.cpp +++ b/src/plugins/coreplugin/messageoutputwindow.cpp @@ -27,9 +27,7 @@ #include "outputwindow.h" #include "icontext.h" #include "coreconstants.h" -#include "find/basetextfind.h" -#include #include #include @@ -45,14 +43,6 @@ MessageOutputWindow::MessageOutputWindow() { m_widget = new OutputWindow(Context(Constants::C_GENERAL_OUTPUT_PANE), zoomSettingsKey); m_widget->setReadOnly(true); - // Let selected text be colored as if the text edit was editable, - // otherwise the highlight for searching is too light - QPalette p = m_widget->palette(); - QColor activeHighlight = p.color(QPalette::Active, QPalette::Highlight); - p.setColor(QPalette::Highlight, activeHighlight); - QColor activeHighlightedText = p.color(QPalette::Active, QPalette::HighlightedText); - p.setColor(QPalette::HighlightedText, activeHighlightedText); - m_widget->setPalette(p); connect(this, &IOutputPane::zoomInRequested, m_widget, &Core::OutputWindow::zoomIn); connect(this, &IOutputPane::zoomOutRequested, m_widget, &Core::OutputWindow::zoomOut); @@ -60,10 +50,6 @@ MessageOutputWindow::MessageOutputWindow() connect(this, &IOutputPane::fontChanged, m_widget, &OutputWindow::setBaseFont); connect(this, &IOutputPane::wheelZoomEnabledChanged, m_widget, &OutputWindow::setWheelZoomEnabled); - auto agg = new Aggregation::Aggregate; - agg->add(m_widget); - agg->add(new BaseTextFind(m_widget)); - setupFilterUi("MessageOutputPane.Filter"); setFilteringEnabled(true); setupContext(Constants::C_GENERAL_OUTPUT_PANE, m_widget); diff --git a/src/plugins/coreplugin/outputwindow.cpp b/src/plugins/coreplugin/outputwindow.cpp index 138001c104d..97885852fb9 100644 --- a/src/plugins/coreplugin/outputwindow.cpp +++ b/src/plugins/coreplugin/outputwindow.cpp @@ -26,11 +26,13 @@ #include "outputwindow.h" #include "actionmanager/actionmanager.h" -#include "editormanager/editormanager.h" #include "coreconstants.h" #include "coreplugin.h" +#include "editormanager/editormanager.h" +#include "find/basetextfind.h" #include "icore.h" +#include #include #include @@ -176,6 +178,19 @@ OutputWindow::OutputWindow(Context context, const QString &settingsKey, QWidget float zoom = Core::ICore::settings()->value(d->settingsKey).toFloat(); setFontZoom(zoom); } + + // Let selected text be colored as if the text edit was editable, + // otherwise the highlight for searching is too light + QPalette p = palette(); + QColor activeHighlight = p.color(QPalette::Active, QPalette::Highlight); + p.setColor(QPalette::Highlight, activeHighlight); + QColor activeHighlightedText = p.color(QPalette::Active, QPalette::HighlightedText); + p.setColor(QPalette::HighlightedText, activeHighlightedText); + setPalette(p); + + auto agg = new Aggregation::Aggregate; + agg->add(this); + agg->add(new BaseTextFind(this)); } OutputWindow::~OutputWindow() diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index ae2e480a1f1..9a6d512bc34 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -447,9 +446,6 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc) connect(TextEditor::TextEditorSettings::instance(), &TextEditor::TextEditorSettings::behaviorSettingsChanged, ow, updateBehaviorSettings); - auto *agg = new Aggregation::Aggregate; - agg->add(ow); - agg->add(new Core::BaseTextFind(ow)); m_runControlTabs.push_back(RunControlTab(rc, ow)); m_tabWidget->addTab(ow, rc->displayName()); qCDebug(appOutputLog) << "AppOutputPane::createNewOutputWindow: Adding tab for" << rc; diff --git a/src/plugins/projectexplorer/compileoutputwindow.cpp b/src/plugins/projectexplorer/compileoutputwindow.cpp index 74d6e2f485c..609321f425f 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.cpp +++ b/src/plugins/projectexplorer/compileoutputwindow.cpp @@ -35,7 +35,6 @@ #include "taskhub.h" #include -#include #include #include #include @@ -93,15 +92,6 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) : parser->runPostPrintActions(); }); - // Let selected text be colored as if the text edit was editable, - // otherwise the highlight for searching is too light - QPalette p = m_outputWindow->palette(); - QColor activeHighlight = p.color(QPalette::Active, QPalette::Highlight); - p.setColor(QPalette::Highlight, activeHighlight); - QColor activeHighlightedText = p.color(QPalette::Active, QPalette::HighlightedText); - p.setColor(QPalette::HighlightedText, activeHighlightedText); - m_outputWindow->setPalette(p); - Utils::ProxyAction *cancelBuildProxyButton = Utils::ProxyAction::proxyActionWithIcon(cancelBuildAction, Utils::Icons::STOP_SMALL_TOOLBAR.icon()); @@ -135,10 +125,6 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) : Core::ICore::showOptionsDialog(OPTIONS_PAGE_ID); }); - auto agg = new Aggregation::Aggregate; - agg->add(m_outputWindow); - agg->add(new Core::BaseTextFind(m_outputWindow)); - qRegisterMetaType("QTextCharFormat"); m_handler = new ShowOutputTaskHandler(this); diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index 4691cbd7d89..76d66be2547 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -111,6 +112,8 @@ BuildSystemOutputWindow::BuildSystemOutputWindow() : OutputWindow(Context(kBuildSystemOutputContext), "ProjectsMode.BuildSystemOutput.Zoom") , m_clear(new QAction) { + setReadOnly(true); + Command *clearCommand = ActionManager::command(Core::Constants::OUTPUTPANE_CLEAR); m_clear->setIcon(Utils::Icons::CLEAN_TOOLBAR.icon()); m_clear->setText(clearCommand->action()->text()); @@ -624,8 +627,10 @@ public: q->addDockWidget(Qt::LeftDockWidgetArea, selectorDock); m_buildSystemOutput = new BuildSystemOutputWindow; - m_buildSystemOutput->setReadOnly(true); auto output = new QWidget; + // ProjectWindow sets background role to Base which is wrong for the output window, + // especially the find tool bar (resulting in wrong label color) + output->setBackgroundRole(QPalette::Window); output->setObjectName("BuildSystemOutput"); output->setWindowTitle(ProjectWindow::tr("Build System Output")); auto outputLayout = new QVBoxLayout; @@ -634,6 +639,7 @@ public: outputLayout->setSpacing(0); 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); } diff --git a/src/plugins/vcsbase/vcsoutputwindow.cpp b/src/plugins/vcsbase/vcsoutputwindow.cpp index ebec3840dc5..5bba47a1a1c 100644 --- a/src/plugins/vcsbase/vcsoutputwindow.cpp +++ b/src/plugins/vcsbase/vcsoutputwindow.cpp @@ -27,8 +27,6 @@ #include -#include -#include #include #include #include @@ -123,9 +121,6 @@ OutputWindowPlainTextEdit::OutputWindowPlainTextEdit(QWidget *parent) : outputFormatter()->setBoldFontEnabled(false); m_parser = new VcsOutputLineParser; setLineParsers({m_parser}); - auto agg = new Aggregation::Aggregate; - agg->add(this); - agg->add(new Core::BaseTextFind(this)); } // Search back for beginning of word