Appearance Mode
This option allows user adjust displaying mode - between Light and Dark. Default setting is qual to currently using in OS. Part of code, which clearly shows differences between those two:
style = ttk.Style()
style.theme_use("clam")
if customtkinter.get_appearance_mode() == "Dark":
style.configure("Treeview",
background="#2b2b2b",
foreground="white",
fieldbackground="#2b2b2b",
font=('Courier', 10))
style.configure("Treeview.Heading",
background="#3c3f41",
foreground="white",
font=('Courier', 10, 'bold'))
style.map('Treeview', background=[('selected', '#0078d7')], foreground=[('selected', 'white')])
self.transaction_tree.tag_configure('oddrow', background="#2b2b2b")
self.transaction_tree.tag_configure('evenrow', background="#3c3f41")
self.transaction_tree.tag_configure('in_transaction', foreground='#00FF00')
self.transaction_tree.tag_configure('out_transaction', foreground='#FF0000')
else:
style.configure("Treeview",
background="white",
foreground="black",
fieldbackground="white",
font=('Courier', 10))
style.configure("Treeview.Heading",
background="#f0f0f0",
foreground="black",
font=('Courier', 10, 'bold'))
style.map('Treeview', background=[('selected', '#0078d7')], foreground=[('selected', 'white')])
self.transaction_tree.tag_configure('oddrow', background="white")
self.transaction_tree.tag_configure('evenrow', background="#f0f0f0")
self.transaction_tree.tag_configure('in_transaction', foreground='green')
self.transaction_tree.tag_configure('out_transaction', foreground='red')
Last updated