[LyX/master] GuiSearch: properly display indicators in dark mode

Juergen Spitzmueller spitz at lyx.org
Thu Feb 18 14:41:05 UTC 2021


commit 9ee73dbb305d84aa0d0033f861bb759ac12d862a
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Thu Feb 18 15:44:27 2021 +0100

    GuiSearch: properly display indicators in dark mode
---
 src/frontends/qt/GuiSearch.cpp |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt/GuiSearch.cpp b/src/frontends/qt/GuiSearch.cpp
index 323ac8a..0d3790c 100644
--- a/src/frontends/qt/GuiSearch.cpp
+++ b/src/frontends/qt/GuiSearch.cpp
@@ -226,7 +226,7 @@ void GuiSearchWidget::handleIndicators()
 		if (pms > 0) {
 			int const gap = 3;
 			QPixmap tpixmap(pms * (bpixmap.width() + gap), bpixmap.height());
-			tpixmap.fill();
+			tpixmap.fill(Qt::transparent);
 			QPainter painter(&tpixmap);
 			int x = 0;
 			
@@ -263,9 +263,20 @@ void GuiSearchWidget::handleIndicators()
 				x += spixmap.width() + gap;
 			}
 			tip += "</ul>";
+			painter.end();
+			if (guiApp && guiApp->isInDarkMode()) {
+				QImage img = tpixmap.toImage();
+				img.invertPixels();
+				tpixmap.convertFromImage(img);
+			}
 			findLE_->setButtonPixmap(FancyLineEdit::Right, tpixmap);
 		} else {
 			tip = qt_("Click here to change search options");
+			if (guiApp && guiApp->isInDarkMode()) {
+				QImage img = bpixmap.toImage();
+				img.invertPixels();
+				bpixmap.convertFromImage(img);
+			}
 			findLE_->setButtonPixmap(FancyLineEdit::Right, bpixmap);
 		}
 	}


More information about the lyx-cvs mailing list