From 1ca13ce62d59b949e40b061531a7e5faae27ee54 Mon Sep 17 00:00:00 2001 From: Laurent Trinques Date: Thu, 1 Oct 2026 16:03:46 +0200 Subject: [PATCH] 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 --- sources/SearchAndReplace/ui/searchandreplacewidget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sources/SearchAndReplace/ui/searchandreplacewidget.cpp b/sources/SearchAndReplace/ui/searchandreplacewidget.cpp index 998e1b2ad..f2ab2e991 100644 --- a/sources/SearchAndReplace/ui/searchandreplacewidget.cpp +++ b/sources/SearchAndReplace/ui/searchandreplacewidget.cpp @@ -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