]> git.lyx.org Git - features.git/commitdiff
GuiSearch: properly display indicators in dark mode
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 18 Feb 2021 14:44:27 +0000 (15:44 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 18 Feb 2021 14:44:27 +0000 (15:44 +0100)
src/frontends/qt/GuiSearch.cpp

index 323ac8affd2a4e6f29d495a4f66ef138c59146e4..0d3790c40dbc533db64a655659383e89cc55582f 100644 (file)
@@ -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);
                }
        }