From 2529edb78aa678fe36cbf12b73dc061e705abea5 Mon Sep 17 00:00:00 2001 From: Matthias Metelka <62722460+kleinerpirat@users.noreply.github.com> Date: Mon, 16 Jan 2023 09:44:37 +0100 Subject: [PATCH] Improve native theme on other systems by not forcing palette with the caveat that theme switching can get weird. --- qt/aqt/theme.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qt/aqt/theme.py b/qt/aqt/theme.py index 8c8e6c2bd..7be03deb1 100644 --- a/qt/aqt/theme.py +++ b/qt/aqt/theme.py @@ -267,8 +267,10 @@ class ThemeManager: def _apply_palette(self, app: QApplication) -> None: set_macos_dark_mode(self.night_mode) - if is_mac and not ( - qtmajor == 5 or aqt.mw.pm.get_widget_style() == AnkiStyles.ANKI + if ( + aqt.mw.pm.get_widget_style() == AnkiStyles.NATIVE + or is_mac + and not (qtmajor == 5 or aqt.mw.pm.get_widget_style() == AnkiStyles.ANKI) ): app.setStyle(QStyleFactory.create(self._default_style)) # type: ignore self.default_palette.setColor(