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): " +
|
sys.stderr.write("WARNING (customtkinter.enable_macos_darkmode): " +
|
||||||
"This command forces macOS dark-mode on all programs." +
|
"This command forces macOS dark-mode on all programs." +
|
||||||
"This can cause bugs on some other programs.\n" +
|
"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:
|
else:
|
||||||
sys.stderr.write("WARNING (customtkinter.enable_macos_darkmode): " +
|
sys.stderr.write("WARNING (customtkinter.enable_macos_darkmode): " +
|
||||||
"Currently this works only with anaconda python version (Tcl/Tk >= 8.6.9).\n" +
|
"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)
|
AppearanceModeTracker.init_listener_function(no_thread=True)
|
||||||
sys.stderr.write("WARNING (customtkinter.deactivate_threading): Automatic threaded search for a change of the " +
|
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 " +
|
"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():
|
def activate_threading():
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
from threading import Thread
|
from threading import Thread
|
||||||
from time import sleep
|
from time import sleep
|
||||||
import darkdetect
|
|
||||||
import sys
|
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):
|
class SystemAppearanceModeListener(Thread):
|
||||||
""" This class checks for a system appearance change
|
""" This class checks for a system appearance change
|
||||||
|
@ -16,8 +16,6 @@ class CTkColorManager:
|
|||||||
cls.MAIN = (hex_color, hex_color)
|
cls.MAIN = (hex_color, hex_color)
|
||||||
cls.MAIN_HOVER = (hex_color_hover, hex_color_hover)
|
cls.MAIN_HOVER = (hex_color_hover, hex_color_hover)
|
||||||
|
|
||||||
print(CTkColorManager.MAIN, id(CTkColorManager))
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def set_theme(cls, main_color):
|
def set_theme(cls, main_color):
|
||||||
if main_color.lower() == "green":
|
if main_color.lower() == "green":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user