-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui_theme.py
More file actions
126 lines (108 loc) · 4.62 KB
/
Copy pathgui_theme.py
File metadata and controls
126 lines (108 loc) · 4.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
"""
Theme and styling utilities for Script to Voice Generator GUI
"""
from ttkbootstrap import Style
from config import APP_THEME
def apply_app_theme(root):
"""Apply custom dark theme to the application"""
style = Style()
colors = APP_THEME["colors"]
root.configure(bg=colors["bg"])
# Base style
style.configure(".",
background=colors["bg"],
foreground=colors["fg"],
bordercolor=colors["border"],
darkcolor=colors["bg"],
lightcolor=colors["selectbg"],
troughcolor=colors["inputbg"],
selectbackground=colors["selectbg"],
selectforeground=colors["selectfg"],
fieldbackground=colors["inputbg"],
font=("Consolas", 10),
borderwidth=1)
# Frame styles
style.configure("TFrame", background=colors["bg"])
style.configure("TLabelframe", background=colors["bg"],
bordercolor=colors["border"],
foreground=colors["fg"])
style.configure("TLabelframe.Label", background=colors["bg"],
foreground=colors["accent"],
font=("Consolas", 11, "bold"))
# Label styles
style.configure("TLabel", background=colors["bg"],
foreground=colors["fg"])
# Notebook (tab) styles
style.configure("TNotebook", background=colors["bg"],
bordercolor=colors["border"])
style.configure("TNotebook.Tab",
background=colors["inputbg"],
foreground=colors["fg"],
padding=[12, 6],
font=("Consolas", 10, "bold"))
style.map("TNotebook.Tab",
background=[("selected", colors["primary"]),
("active", colors["active"])],
foreground=[("selected", colors["selectfg"])])
# Entry and Combobox
style.configure("TEntry", fieldbackground=colors["inputbg"],
foreground=colors["inputfg"],
bordercolor=colors["border"],
insertcolor=colors["inputfg"])
style.configure("TCombobox", fieldbackground=colors["inputbg"],
background=colors["inputbg"],
foreground=colors["inputfg"],
bordercolor=colors["border"],
arrowcolor=colors["fg"])
style.map("TCombobox",
fieldbackground=[("readonly", colors["inputbg"])])
# Checkbutton and Radiobutton
style.configure("TCheckbutton", background=colors["bg"],
foreground=colors["fg"])
style.configure("TRadiobutton", background=colors["bg"],
foreground=colors["fg"])
# Scale (slider)
style.configure("TScale", background=colors["bg"],
troughcolor=colors["inputbg"],
bordercolor=colors["border"],
darkcolor=colors["primary"],
lightcolor=colors["primary"])
# Button styles
style.configure("info.TButton",
background=colors["info"],
foreground=colors["selectfg"],
bordercolor=colors["border"],
focuscolor=colors["active"])
style.map("info.TButton",
background=[("active", colors["active"])])
style.configure("warning.TButton",
background=colors["warning"],
foreground=colors["selectfg"],
bordercolor=colors["border"])
style.map("warning.TButton",
background=[("active", colors["primary"])])
style.configure("success.TButton",
background=colors["success"],
foreground=colors["selectfg"],
bordercolor="#00305A")
style.map("success.TButton",
background=[("active", "#1A8FE3")])
style.configure("primary.TButton",
background=colors["primary"],
foreground=colors["selectfg"],
bordercolor=colors["border"])
style.map("primary.TButton",
background=[("active", colors["active"])])
# Scrollbar
style.configure("Vertical.TScrollbar",
background=colors["inputbg"],
troughcolor=colors["bg"],
bordercolor=colors["border"],
arrowcolor=colors["fg"])
# Separator
style.configure("TSeparator", background=colors["border"])
# Progressbar
style.configure("TProgressbar",
background=colors["primary"],
troughcolor=colors["inputbg"],
bordercolor=colors["border"])