added orientation for CTkSLider, CTkProgressBar

This commit is contained in:
Tom Schimansky
2022-05-16 16:51:19 +02:00
parent a688d07b2a
commit b21c3fa19a
45 changed files with 458 additions and 63 deletions

View File

@@ -1,5 +1,6 @@
__version__ = "3.12"
# import widgets
from .widgets.ctk_button import CTkButton
from .widgets.ctk_checkbox import CTkCheckBox
from .widgets.ctk_entry import CTkEntry
@@ -11,47 +12,22 @@ from .widgets.ctk_radiobutton import CTkRadioButton
from .widgets.ctk_canvas import CTkCanvas
from .widgets.ctk_switch import CTkSwitch
# import windows
from .windows.ctk_tk import CTk
from .windows.ctk_toplevel import CTkToplevel
from .windows.ctk_input_dialog import CTkInputDialog
# import other classes
from .ctk_settings import CTkSettings
from .appearance_mode_tracker import AppearanceModeTracker
from .theme_manager import CTkThemeManager
from .ctk_theme_manager import CTkThemeManager
from .scaling_tracker import ScalingTracker
from distutils.version import StrictVersion as Version
import tkinter
import os
import sys
import shutil
def enable_macos_darkmode():
if sys.platform == "darwin": # macOS
if Version(tkinter.Tcl().call("info", "patchlevel")) >= Version("8.6.9"): # Tcl/Tk >= 8.6.9
os.system("defaults write -g NSRequiresAquaSystemAppearance -bool No")
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")
else:
sys.stderr.write("WARNING (customtkinter.enable_macos_darkmode): " +
"Currently this works only with anaconda python version (Tcl/Tk >= 8.6.9).\n" +
"(python.org Tcl/Tk version is only 8.6.8)\n")
else:
sys.stderr.write("WARNING (customtkinter.enable_macos_darkmode): " +
"System is not macOS, but the following: {}\n".format(sys.platform))
def disable_macos_darkmode():
if sys.platform == "darwin": # macOS
if Version(tkinter.Tcl().call("info", "patchlevel")) >= Version("8.6.9"): # Tcl/Tk >= 8.6.9
os.system("defaults delete -g NSRequiresAquaSystemAppearance")
# This command reverts the dark-mode setting for all programs.
def set_appearance_mode(mode_string):
AppearanceModeTracker.set_appearance_mode(mode_string)