Add text search functionality to output window centrally

All output windows should be searchable with Edit > Find/Replace
(Ctrl+F), no reason for every single instance setting that up
individually.

Add a find placeholder for the build system output in Projects mode, so
the search functionality is available there as well.

Change-Id: Idad6824bfb21e6ae9ab923191a7e83b43256e68b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Eike Ziller
2021-09-14 16:42:05 +02:00
parent 9815d2ee7e
commit 29df497d25
6 changed files with 23 additions and 39 deletions

View File

@@ -35,7 +35,6 @@
#include "taskhub.h"
#include <coreplugin/outputwindow.h>
#include <coreplugin/find/basetextfind.h>
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
#include <extensionsystem/pluginmanager.h>
@@ -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>("QTextCharFormat");
m_handler = new ShowOutputTaskHandler(this);