Changeset View
Changeset View
Standalone View
Standalone View
src/vimode/emulatedcommandbar/matchhighlighter.cpp
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | |||||
48 | { | 48 | { | ||
49 | // Note that if matchRange is invalid, the highlight will not be shown, so we | 49 | // Note that if matchRange is invalid, the highlight will not be shown, so we | ||
50 | // don't need to check for that explicitly. | 50 | // don't need to check for that explicitly. | ||
51 | m_highlightedMatch->setRange(matchRange); | 51 | m_highlightedMatch->setRange(matchRange); | ||
52 | } | 52 | } | ||
53 | 53 | | |||
54 | void MatchHighlighter::updateMatchHighlightAttrib() | 54 | void MatchHighlighter::updateMatchHighlightAttrib() | ||
55 | { | 55 | { | ||
56 | const QColor &matchColour = m_view->renderer()->config()->searchHighlightColor(); | 56 | const QColor &matchBg = m_view->renderer()->config()->searchHighlightColor(); | ||
57 | const QColor &matchFg = m_view->defaultStyleAttribute(KTextEditor::dsNormal)->selectedForeground().color(); | ||||
57 | if (!m_highlightMatchAttribute) { | 58 | if (!m_highlightMatchAttribute) { | ||
58 | m_highlightMatchAttribute = new KTextEditor::Attribute; | 59 | m_highlightMatchAttribute = new KTextEditor::Attribute; | ||
59 | } | 60 | } | ||
60 | m_highlightMatchAttribute->setBackground(matchColour); | 61 | m_highlightMatchAttribute->setBackground(matchBg); | ||
62 | m_highlightMatchAttribute->setForeground(matchFg); | ||||
61 | KTextEditor::Attribute::Ptr mouseInAttribute(new KTextEditor::Attribute()); | 63 | KTextEditor::Attribute::Ptr mouseInAttribute(new KTextEditor::Attribute()); | ||
62 | m_highlightMatchAttribute->setDynamicAttribute(KTextEditor::Attribute::ActivateMouseIn, mouseInAttribute); | 64 | m_highlightMatchAttribute->setDynamicAttribute(KTextEditor::Attribute::ActivateMouseIn, mouseInAttribute); | ||
63 | m_highlightMatchAttribute->dynamicAttribute(KTextEditor::Attribute::ActivateMouseIn)->setBackground(matchColour); | 65 | m_highlightMatchAttribute->dynamicAttribute(KTextEditor::Attribute::ActivateMouseIn)->setBackground(matchBg); | ||
66 | m_highlightMatchAttribute->dynamicAttribute(KTextEditor::Attribute::ActivateMouseIn)->setForeground(matchFg); | ||||
64 | } | 67 | } |