commit eefe9f7889c79c09c9b63fa4c5ee510564531802
Author: Juergen Spitzmueller <[email protected]>
Date: Wed Mar 12 08:15:34 2025 +0100
Fix pen color in getScaledPixmap
This generated wrong pixmaps in dark mode
(cherry picked from commit 7ba06e8812842c1d2bf22179f86823954da99e11)
---
src/frontends/qt/GuiApplication.cpp | 5 +++++
status.24x | 2 ++
2 files changed, 7 insertions(+)
diff --git a/src/frontends/qt/GuiApplication.cpp
b/src/frontends/qt/GuiApplication.cpp
index e2494ac048..bb9fa9302c 100644
--- a/src/frontends/qt/GuiApplication.cpp
+++ b/src/frontends/qt/GuiApplication.cpp
@@ -2713,6 +2713,7 @@ QPixmap GuiApplication::getScaledPixmap(QString imagedir,
QString name) const
// We render SVG directly for HiDPI scalability
QPixmap pm = getPixmap(imagedir, name, "svgz,png");
FileName fname = imageLibFileSearch(imagedir, name, "svgz,png");
+ bool const dark_mode = theGuiApp() ? theGuiApp()->isInDarkMode() :
false;
QString fpath = toqstr(fname.absFileName());
if (!fpath.isEmpty() && !fpath.endsWith(".png")) {
QSvgRenderer svgRenderer(fpath);
@@ -2721,6 +2722,10 @@ QPixmap GuiApplication::getScaledPixmap(QString
imagedir, QString name) const
pm.fill(Qt::transparent);
QPainter painter(&pm);
svgRenderer.render(&painter);
+
painter.setCompositionMode(QPainter::CompositionMode_SourceIn);
+ QColor const penColor = dark_mode ? Qt::lightGray :
Qt::darkGray;
+ painter.fillRect(pm.rect(), penColor);
+ painter.end();
pm.setDevicePixelRatio(dpr);
}
}
diff --git a/status.24x b/status.24x
index 6070b62e38..9953fb0d7a 100644
--- a/status.24x
+++ b/status.24x
@@ -89,6 +89,8 @@ What's new
- Fix display of accented characters in math (bug 13156).
+- Fix display of some icons in dialogs in dark mode.
+
* INTERNALS
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs