Changeset View
Changeset View
Standalone View
Standalone View
addons/search/plugin_search.cpp
Show First 20 Lines • Show All 714 Lines • ▼ Show 20 Line(s) | 708 | { | |||
---|---|---|---|---|---|
715 | 715 | | |||
716 | bool replace = ((sender() == &m_replacer) || (sender() == 0) || (sender() == m_ui.replaceButton)); | 716 | bool replace = ((sender() == &m_replacer) || (sender() == 0) || (sender() == m_ui.replaceButton)); | ||
717 | if (replace) { | 717 | if (replace) { | ||
718 | QColor replaceColor(Qt::green); | 718 | QColor replaceColor(Qt::green); | ||
719 | if (ciface) replaceColor = ciface->configValue(QStringLiteral("replace-highlight-color")).value<QColor>(); | 719 | if (ciface) replaceColor = ciface->configValue(QStringLiteral("replace-highlight-color")).value<QColor>(); | ||
720 | attr->setBackground(replaceColor); | 720 | attr->setBackground(replaceColor); | ||
721 | 721 | | |||
722 | if (activeView) { | 722 | if (activeView) { | ||
723 | attr->setForeground(activeView->defaultStyleAttribute(KTextEditor::dsNormal)->foreground().color()); | 723 | attr->setForeground(activeView->defaultStyleAttribute(KTextEditor::dsNormal)->selectedForeground().color()); | ||
724 | } | 724 | } | ||
725 | } | 725 | } | ||
726 | else { | 726 | else { | ||
727 | QColor searchColor(Qt::yellow); | 727 | QColor searchColor(Qt::yellow); | ||
728 | if (ciface) searchColor = ciface->configValue(QStringLiteral("search-highlight-color")).value<QColor>(); | 728 | if (ciface) searchColor = ciface->configValue(QStringLiteral("search-highlight-color")).value<QColor>(); | ||
729 | attr->setBackground(searchColor); | 729 | attr->setBackground(searchColor); | ||
730 | 730 | | |||
731 | if (activeView) { | 731 | if (activeView) { | ||
732 | attr->setForeground(activeView->defaultStyleAttribute(KTextEditor::dsNormal)->foreground().color()); | 732 | attr->setForeground(activeView->defaultStyleAttribute(KTextEditor::dsNormal)->selectedForeground().color()); | ||
733 | } | 733 | } | ||
734 | } | 734 | } | ||
735 | // calculate end line in case of multi-line match | 735 | // calculate end line in case of multi-line match | ||
736 | int endLine = line; | 736 | int endLine = line; | ||
737 | int endColumn = column + matchLen; | 737 | int endColumn = column + matchLen; | ||
738 | while ((endLine < doc->lines()) && (endColumn > doc->line(endLine).size())) { | 738 | while ((endLine < doc->lines()) && (endColumn > doc->line(endLine).size())) { | ||
739 | endColumn -= doc->line(endLine).size(); | 739 | endColumn -= doc->line(endLine).size(); | ||
740 | endColumn--; // remove one for '\n' | 740 | endColumn--; // remove one for '\n' | ||
▲ Show 20 Lines • Show All 1373 Lines • Show Last 20 Lines |