Reduce icon memory usage. By @samuel-w (#656)

This commit is contained in:
Samuel Woon 2020-09-18 00:40:11 -05:00 committed by GitHub
parent a86683e2b8
commit b161296996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -10,4 +10,8 @@ def get_colored_icon(icon_name):
if uses_dark_mode(): if uses_dark_mode():
svg_str = svg_str.replace(b'#00000', b'#ffffff') svg_str = svg_str.replace(b'#00000', b'#ffffff')
svg_img = QImage.fromData(svg_str) svg_img = QImage.fromData(svg_str)
# Reduce image size to 1/14th
svg_img = svg_img.scaled(svg_img.size() / 14)
return QIcon(QPixmap(svg_img)) return QIcon(QPixmap(svg_img))