mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
Attempt to fix broken native theme on macOS
This commit is contained in:
parent
585f7354b1
commit
792b834109
1 changed files with 11 additions and 0 deletions
|
@ -267,6 +267,17 @@ 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):
|
||||
app.setStyle(QStyleFactory.create(self._default_style)) # type: ignore
|
||||
self.default_palette.setColor(
|
||||
QPalette.ColorRole.Window, self.qcolor(colors.CANVAS)
|
||||
)
|
||||
self.default_palette.setColor(
|
||||
QPalette.ColorRole.AlternateBase, self.qcolor(colors.CANVAS)
|
||||
)
|
||||
app.setPalette(self.default_palette)
|
||||
return
|
||||
|
||||
app.setStyle(QStyleFactory.create("fusion")) # type: ignore
|
||||
|
||||
palette = QPalette()
|
||||
|
|
Loading…
Reference in a new issue