Fix editor color scheme

Use the defined foreground for search scope instead of calculating
something from background. Support empty foreground for the standard
selections (allows us to match certain popular colorschemes)
This commit is contained in:
mae
2010-08-06 12:59:02 +02:00
parent e179912a90
commit 47046ec1ce
4 changed files with 128 additions and 101 deletions

View File

@@ -2433,7 +2433,7 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
TextEditorOverlay *overlay = new TextEditorOverlay(this);
overlay->addOverlaySelection(d->m_findScopeStart.position(),
d->m_findScopeEnd.position(),
d->m_searchScopeFormat.background().color().darker(120),
d->m_searchScopeFormat.foreground().color(),
d->m_searchScopeFormat.background().color(),
TextEditorOverlay::ExpandBegin);
overlay->setAlpha(false);
@@ -2525,7 +2525,7 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
}
painter.fillRect(rr, d->m_searchScopeFormat.background());
QColor lineCol = d->m_searchScopeFormat.background().color().darker(120);
QColor lineCol = d->m_searchScopeFormat.foreground().color();
QPen pen = painter.pen();
painter.setPen(lineCol);
if (blockFS == d->m_findScopeStart.block())
@@ -5078,7 +5078,9 @@ void BaseTextEditor::setFontSettings(const TextEditor::FontSettings &fs)
p.setColor(QPalette::Highlight, (selectionFormat.background().style() != Qt::NoBrush) ?
selectionFormat.background().color() :
QApplication::palette().color(QPalette::Highlight));
p.setColor(QPalette::HighlightedText, selectionFormat.foreground().color());
p.setBrush(QPalette::HighlightedText, selectionFormat.foreground());
p.setBrush(QPalette::Inactive, QPalette::Highlight, p.highlight());
p.setBrush(QPalette::Inactive, QPalette::HighlightedText, p.highlightedText());
setPalette(p);