Fix unreadable search field in the Search and Replace widget (dark theme)

The search field gets a light green or light red background to show
whether the text matches, but only QPalette::Base was set. With a dark
theme the text colour is light too, so the typed text was light on
light and could not be read.

Set QPalette::Text to black together with the light background.

Fixes #1209
This commit is contained in:
Laurent Trinques
2026-10-01 16:03:46 +02:00
parent c7d31c08e4
commit 1ca13ce62d
@@ -446,6 +446,9 @@ void SearchAndReplaceWidget::search()
background.setColor(QPalette::Base, match
? QColor("#E0FFF0")
: QColor("#FFE0EF"));
//The background is always light: keep the text dark, or it is
//unreadable (light on light) with a dark theme.
background.setColor(QPalette::Text, Qt::black);
ui->m_search_le->setPalette(background);
//Go to the first occurrence