mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
darkdetct
This commit is contained in:
parent
d81c1a3ead
commit
cf7242ef06
@ -22,7 +22,7 @@ def enable_macos_darkmode():
|
||||
sys.stderr.write("WARNING (customtkinter.enable_macos_darkmode): " +
|
||||
"This command forces macOS dark-mode on all programs." +
|
||||
"This can cause bugs on some other programs.\n" +
|
||||
"Disable it by calling customtkinter.disable_macos_darkmode at the end of the program.\n")
|
||||
"Disable it by calling customtkinter.disable_macos_darkmode() at the end of the program.\n")
|
||||
else:
|
||||
sys.stderr.write("WARNING (customtkinter.enable_macos_darkmode): " +
|
||||
"Currently this works only with anaconda python version (Tcl/Tk >= 8.6.9).\n" +
|
||||
@ -58,7 +58,7 @@ def deactivate_threading():
|
||||
AppearanceModeTracker.init_listener_function(no_thread=True)
|
||||
sys.stderr.write("WARNING (customtkinter.deactivate_threading): Automatic threaded search for a change of the " +
|
||||
"system appearance mode is deativated now.\nYou have to update the appearance mode manually " +
|
||||
"in your mainloop by calling customtkinter.update_theme() every time.\n")
|
||||
"in your mainloop by calling customtkinter.update_appearance_mode() every time.\n")
|
||||
|
||||
|
||||
def activate_threading():
|
||||
|
@ -1,8 +1,13 @@
|
||||
from threading import Thread
|
||||
from time import sleep
|
||||
import darkdetect
|
||||
import sys
|
||||
|
||||
if sys.platform == "darwin":
|
||||
try:
|
||||
import darkdetect
|
||||
except ImportError as e:
|
||||
sys.stderr.write(e + "\nYou have to install darkdetect: pip install darkdetect")
|
||||
|
||||
|
||||
class SystemAppearanceModeListener(Thread):
|
||||
""" This class checks for a system appearance change
|
||||
|
@ -16,8 +16,6 @@ class CTkColorManager:
|
||||
cls.MAIN = (hex_color, hex_color)
|
||||
cls.MAIN_HOVER = (hex_color_hover, hex_color_hover)
|
||||
|
||||
print(CTkColorManager.MAIN, id(CTkColorManager))
|
||||
|
||||
@classmethod
|
||||
def set_theme(cls, main_color):
|
||||
if main_color.lower() == "green":
|
||||
|
Loading…
Reference in New Issue
Block a user