diff --git a/qt/aqt/profiles.py b/qt/aqt/profiles.py index 8fea6442f..eca41b593 100644 --- a/qt/aqt/profiles.py +++ b/qt/aqt/profiles.py @@ -546,6 +546,12 @@ create table if not exists profiles def set_theme(self, theme: Theme) -> None: self.meta["theme"] = theme.value + def force_custom_styles(self) -> bool: + return self.meta.get("force_custom_styles", False) + + def set_force_custom_styles(self, enabled: bool) -> None: + self.meta["force_custom_styles"] = enabled + def browser_layout(self) -> BrowserLayout: from aqt.browser.layout import BrowserLayout diff --git a/qt/aqt/theme.py b/qt/aqt/theme.py index c3a378bc4..ad771f653 100644 --- a/qt/aqt/theme.py +++ b/qt/aqt/theme.py @@ -231,7 +231,7 @@ class ThemeManager: buf = splitter_styles(self) - if not is_mac: + if not is_mac or aqt.mw.pm.force_custom_styles(): from aqt.stylesheets import ( button_styles, checkbox_styles, @@ -266,7 +266,7 @@ class ThemeManager: def _apply_palette(self, app: QApplication) -> None: set_macos_dark_mode(self.night_mode) - if is_mac: + if is_mac and not aqt.mw.pm.force_custom_styles(): app.setStyle(QStyleFactory.create(self._default_style)) # type: ignore self.default_palette.setColor( QPalette.ColorRole.Window, self.qcolor(colors.CANVAS)