mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
only import darkdetect on a Mac
This commit is contained in:
parent
77912aa225
commit
c70badcd5a
1 changed files with 4 additions and 2 deletions
|
@ -6,8 +6,6 @@ import platform
|
||||||
import sys
|
import sys
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
import darkdetect
|
|
||||||
|
|
||||||
from anki.utils import isMac
|
from anki.utils import isMac
|
||||||
from aqt import QApplication, gui_hooks, isWin
|
from aqt import QApplication, gui_hooks, isWin
|
||||||
from aqt.colors import colors
|
from aqt.colors import colors
|
||||||
|
@ -23,6 +21,10 @@ class ThemeManager:
|
||||||
def macos_dark_mode(self) -> bool:
|
def macos_dark_mode(self) -> bool:
|
||||||
if not getattr(sys, "frozen", False):
|
if not getattr(sys, "frozen", False):
|
||||||
return False
|
return False
|
||||||
|
if not isMac:
|
||||||
|
return False
|
||||||
|
import darkdetect
|
||||||
|
|
||||||
return darkdetect.isDark() is True
|
return darkdetect.isDark() is True
|
||||||
|
|
||||||
def get_night_mode(self) -> bool:
|
def get_night_mode(self) -> bool:
|
||||||
|
|
Loading…
Reference in a new issue