From abe67368b3d8222ba805029fb1e696b7c9a05d8d Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 25 Nov 2021 15:11:46 +0100 Subject: [PATCH] Gui: in search bar set red background color as style sheet because a palette won't work if an application wide style sheet is set --- src/Gui/EditorView.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Gui/EditorView.cpp b/src/Gui/EditorView.cpp index 1ad2f0c972..9f41a88e60 100644 --- a/src/Gui/EditorView.cpp +++ b/src/Gui/EditorView.cpp @@ -820,9 +820,16 @@ void SearchBar::findText(bool skip, bool next, const QString& str) textEditor->setTextCursor(newCursor); - QPalette palette; - palette.setColor(QPalette::Active, QPalette::Base, found ? Qt::white : QColor(255, 80, 80)); - searchText->setPalette(palette); + QString styleSheet; + if (!found) { + styleSheet = QString::fromLatin1( + " QLineEdit {\n" + " background-color: rgb(221,144,161);\n" + " }\n" + ); + } + + searchText->setStyleSheet(styleSheet); } void SearchBar::updateButtons()