How to load "symbolic" icons respecting the dark/light mode?
-
Hello,
based on Free Desktop specifications an application should also provide a "symbolic" version of its logo. This is just a 22x22 pixel one color logo. It is intended to be used in the systray and it adapts to the dark or light mode currently used.This question is not about how to have two icons or an adaptive SVG file. The adaption to dark/light is made by the desktop environment (e.g. gnome). This is my understanding.
So how do I load such an icon in Qt, that it gets adapted? Regarding this screenshot. That symbol (looking like a monochrome radioactive warning sign) should be white when the desktop theme is dark. But it is not.
EDIT: I mean I don't want to make workarounds like this:
# ... painter = QPainter(pixmap) painter.setRenderHint(QPainter.RenderHint.Antialiasing) painter.setPen(Qt.PenStyle.NoPen) painter.setBrush(QColor("white") if is_dark else QColor("black")) # ...