mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Add profile manager setting to force custom qt stylesheets (#2233)
This commit is contained in:
parent
fdaa65e064
commit
627313666e
2 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue