diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 482d1c005..e40ed5660 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -89,6 +89,7 @@ lolilolicon Gesa Stupperich git9527 Vova Selin +qxo <49526356@qq.com> ******************** diff --git a/qt/aqt/theme.py b/qt/aqt/theme.py index 483b4dcfe..cd63fbbbf 100644 --- a/qt/aqt/theme.py +++ b/qt/aqt/theme.py @@ -327,7 +327,11 @@ def get_windows_dark_mode() -> bool: HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", ) - return not QueryValueEx(key, "AppsUseLightTheme")[0] + try: + return not QueryValueEx(key, "AppsUseLightTheme")[0] + except Exception as err: + # key reportedly missing or set to wrong type on some systems + return False def set_macos_dark_mode(enabled: bool) -> bool: