From: Juergen Spitzmueller Date: Thu, 18 Feb 2021 14:44:27 +0000 (+0100) Subject: GuiSearch: properly display indicators in dark mode X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9ee73dbb305d84aa0d0033f861bb759ac12d862a;p=features.git GuiSearch: properly display indicators in dark mode --- diff --git a/src/frontends/qt/GuiSearch.cpp b/src/frontends/qt/GuiSearch.cpp index 323ac8affd..0d3790c40d 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 += ""; + 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); } }