Merge pull request #769 from ynput/bugfix/safe-cache-of-icon

UI Icons: Cache key is safely generated
This commit is contained in:
Jakub Trllo 2024-07-10 16:15:35 +02:00 committed by GitHub
commit be6060b8ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -485,7 +485,10 @@ class _IconsCache:
parts = [icon_type, icon_def["path"]]
elif icon_type in {"awesome-font", "material-symbols"}:
parts = [icon_type, icon_def["name"], icon_def["color"]]
color = icon_def["color"] or ""
if isinstance(color, QtGui.QColor):
color = color.name()
parts = [icon_type, icon_def["name"] or "", color]
return "|".join(parts)
@classmethod