Fix theme handling for PySide6 >= 6.7.0 on Windows

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2024-12-23 19:40:55 +08:00
parent 1316ecb34b
commit 550b3f3217
2 changed files with 16 additions and 4 deletions
+8 -2
View File
@@ -174,8 +174,14 @@ class AppQAction(QTranslatable, SupportThemeChangedCallback, QAction):
if theme == 'Dark':
if PLATFORM == 'Windows':
# Windows. Always use black icon
super().setIcon(bootstrapIcon(self.iconFileName))
# Windows
if versionToValue(PYSIDE6_VERSION) < versionToValue('6.7.0'):
# PySide6 < 6.7.0 has no system theme handling on Windows.
# Always use black icon
super().setIcon(bootstrapIcon(self.iconFileName))
else:
# PySide6 has system theme handling.
super().setIcon(bootstrapIconWhite(self.iconFileName))
else:
if getUbuntuRelease() == '20.04' and self.isTrayAction:
# Ubuntu 20.04 system dark theme does not change tray menu color.
+8 -2
View File
@@ -134,8 +134,14 @@ class XrayAssetViewerQListWidget(SupportThemeChangedCallback, AppQListWidget):
else:
if theme == 'Dark':
if PLATFORM == 'Windows':
# Windows. Always use black icon
item.setIcon(bootstrapIcon('file-earmark.svg'))
# Windows
if versionToValue(PYSIDE6_VERSION) < versionToValue('6.7.0'):
# PySide6 < 6.7.0 has no system theme handling on Windows.
# Always use black icon
item.setIcon(bootstrapIcon('file-earmark.svg'))
else:
# PySide6 has system theme handling.
item.setIcon(bootstrapIconWhite('file-earmark.svg'))
else:
item.setIcon(bootstrapIconWhite('file-earmark.svg'))
else: