aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/find
diff options
context:
space:
mode:
authorErik Verbruggen <[email protected]>2013-03-13 14:00:11 +0100
committerErik Verbruggen <[email protected]>2013-03-14 09:40:36 +0100
commitc8421e66b6ba439fe4f5fc2bd45b957b446128ee (patch)
treea6d576c5c3c3a2897c40997f20d4245905a4ac09 /src/plugins/find
parent41fa8c3528ab084d50093a6113e32c63393ceed7 (diff)
Fix color usage in search result view.
Use the text editor's foreground and background colors everywhere. This prevents "zebra patterns" in the text lines when using a dark background color. Change-Id: I9f072fa08e7d90b9840ad1e1fecee993fa14cedb Reviewed-by: David Schulz <[email protected]>
Diffstat (limited to 'src/plugins/find')
-rw-r--r--src/plugins/find/searchresulttreemodel.cpp12
-rw-r--r--src/plugins/find/searchresulttreeview.cpp4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/find/searchresulttreemodel.cpp b/src/plugins/find/searchresulttreemodel.cpp
index 141ff24fa51..ce9d6f9fc7f 100644
--- a/src/plugins/find/searchresulttreemodel.cpp
+++ b/src/plugins/find/searchresulttreemodel.cpp
@@ -252,12 +252,10 @@ QVariant SearchResultTreeModel::data(const SearchResultTreeItem *row, int role)
result = QVariant();
break;
case Qt::TextColorRole:
- if (row->item.useTextEditorFont)
- result = m_color.textForeground;
+ result = m_color.textForeground;
break;
case Qt::BackgroundRole:
- if (row->item.useTextEditorFont)
- result = m_color.textBackground;
+ result = m_color.textBackground;
break;
case ItemDataRoles::ResultLineRole:
case Qt::DisplayRole:
@@ -273,12 +271,10 @@ QVariant SearchResultTreeModel::data(const SearchResultTreeItem *row, int role)
result = row->item.icon;
break;
case ItemDataRoles::ResultHighlightBackgroundColor:
- if (row->item.useTextEditorFont)
- result = m_color.highlightBackground;
+ result = m_color.highlightBackground;
break;
case ItemDataRoles::ResultHighlightForegroundColor:
- if (row->item.useTextEditorFont)
- result = m_color.highlightForeground;
+ result = m_color.highlightForeground;
break;
case ItemDataRoles::SearchTermStartRole:
result = row->item.textMarkPos;
diff --git a/src/plugins/find/searchresulttreeview.cpp b/src/plugins/find/searchresulttreeview.cpp
index 2fa0df88569..281014e95b8 100644
--- a/src/plugins/find/searchresulttreeview.cpp
+++ b/src/plugins/find/searchresulttreeview.cpp
@@ -61,6 +61,10 @@ void SearchResultTreeView::setAutoExpandResults(bool expand)
void SearchResultTreeView::setTextEditorFont(const QFont &font, const SearchResultColor color)
{
m_model->setTextEditorFont(font, color);
+
+ QPalette p = palette();
+ p.setColor(QPalette::Base, color.textBackground);
+ setPalette(p);
}
void SearchResultTreeView::clear()