The toggle's track is gray (off) ↔ blue (on); the baked `#3D3D3D` fill on the sun/moon SVGs reads as muddy dark-gray-on-blue. Recolor to pure white at load time so the glyphs pop against either track tone. Used only here — keep it local rather than promoting a helper.
| 51 | // to pure white at load time so the glyphs pop against either track |
| 52 | // tone. Used only here — keep it local rather than promoting a helper. |
| 53 | QIcon loadWhiteFillIcon(const QString& resource_path) { |
| 54 | QFile file(resource_path); |
| 55 | if (!file.open(QFile::ReadOnly | QFile::Text)) { |
| 56 | return {}; |
| 57 | } |
| 58 | QByteArray svg = file.readAll(); |
| 59 | svg.replace("#3D3D3D", "#FFFFFF"); |
| 60 | QSvgRenderer renderer(svg); |
| 61 | QImage image(64, 64, QImage::Format_ARGB32); |
| 62 | image.fill(Qt::transparent); |
| 63 | QPainter painter(&image); |
| 64 | renderer.render(&painter); |
| 65 | painter.end(); |
| 66 | return QIcon(QPixmap::fromImage(image)); |
| 67 | } |
| 68 | |
| 69 | } // namespace |
| 70 |
no test coverage detected