Commit 4f56c0fa authored by Milian Wolff's avatar Milian Wolff
Browse files

Cleanup: Use theme editor color to directly query search highlight

parent 3db7bf9b
......@@ -13,7 +13,7 @@
#include <debug.h>
#include <KTextEditor/View>
#include <KTextEditor/ConfigInterface>
#include <KSyntaxHighlighting/Theme>
#define ifDebug(x)
......@@ -68,11 +68,9 @@ void ConfigurableHighlightingColors::reset(ColorCache* cache, KTextEditor::View*
highlightUses->setForeground(highlightUses->selectedForeground());
highlightUses->setBackground(highlightUses->selectedBackground());
highlightUses->setBackgroundFillWhitespace(true);
if (auto iface = qobject_cast<KTextEditor::ConfigInterface*>(view)) {
const auto highlightUsesColor
= iface->configValue(QStringLiteral("search-highlight-color")).value<QColor>();
highlightUses->setBackground(highlightUsesColor);
if (view) {
const auto searchHighlight = view->theme().editorColor(KSyntaxHighlighting::Theme::SearchHighlight);
highlightUses->setBackground(QColor::fromRgb(searchHighlight));
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment