-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-dark.tcl
491 lines (411 loc) · 17 KB
/
azure-dark.tcl
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
# Copyright (c) 2021 rdbende <[email protected]>
# Azure theme is a beautiful modern ttk theme inspired by Microsoft's fluent design.
package require Tk 8.6
namespace eval ttk::theme::azure-dark {
variable version 1.3
package provide ttk::theme::azure-dark $version
variable colors
array set colors {
-fg "#ffffff"
-bg "#333333"
-disabledfg "#ffffff"
-disabledbg "#737373"
-selectfg "#ffffff"
-selectbg "#737373"
}
proc LoadImages {imgdir} {
variable I
foreach file [glob -directory $imgdir *.png] {
set img [file tail [file rootname $file]]
set I($img) [image create photo -file $file -format png]
}
}
LoadImages [file join [file dirname [info script]] azure-dark]
# Settings
ttk::style theme create azure-dark -parent default -settings {
ttk::style configure . \
-background $colors(-bg) \
-foreground $colors(-fg) \
-troughcolor $colors(-bg) \
-focuscolor $colors(-selectbg) \
-selectbackground $colors(-selectbg) \
-selectforeground $colors(-selectfg) \
-fieldbackground $colors(-selectbg) \
-font TkDefaultFont \
-borderwidth 1 \
-relief flat
ttk::style map . -foreground [list disabled $colors(-disabledfg)]
tk_setPalette background [ttk::style lookup . -background] \
foreground [ttk::style lookup . -foreground] \
highlightColor [ttk::style lookup . -focuscolor] \
selectBackground [ttk::style lookup . -selectbackground] \
selectForeground [ttk::style lookup . -selectforeground] \
activeBackground [ttk::style lookup . -selectbackground] \
activeForeground [ttk::style lookup . -selectforeground]
option add *font [ttk::style lookup . -font]
# Layouts
ttk::style layout TButton {
Button.button -children {
Button.padding -children {
Button.label -side left -expand true
}
}
}
ttk::style layout Toolbutton {
Toolbutton.button -children {
Toolbutton.padding -children {
Toolbutton.label -side left -expand true
}
}
}
ttk::style layout TMenubutton {
Menubutton.button -children {
Menubutton.padding -children {
Menubutton.indicator -side right
Menubutton.label -side right -expand true
}
}
}
ttk::style layout TOptionMenu {
OptionMenu.button -children {
OptionMenu.padding -children {
OptionMenu.indicator -side right
OptionMenu.label -side right -expand true
}
}
}
ttk::style layout AccentButton {
AccentButton.button -children {
AccentButton.padding -children {
AccentButton.label -side left -expand true
}
}
}
ttk::style layout TCheckbutton {
Checkbutton.button -children {
Checkbutton.padding -children {
Checkbutton.indicator -side left
Checkbutton.label -side right -expand true
}
}
}
ttk::style layout Switch {
Switch.button -children {
Switch.padding -children {
Switch.indicator -side left
Switch.label -side right -expand true
}
}
}
ttk::style layout ToggleButton {
ToggleButton.button -children {
ToggleButton.padding -children {
ToggleButton.label -side left -expand true
}
}
}
ttk::style layout TRadiobutton {
Radiobutton.button -children {
Radiobutton.padding -children {
Radiobutton.indicator -side left
Radiobutton.label -side right -expand true
}
}
}
ttk::style layout Vertical.TScrollbar {
Vertical.Scrollbar.trough -sticky ns -children {
Vertical.Scrollbar.thumb -expand true
}
}
ttk::style layout Horizontal.TScrollbar {
Horizontal.Scrollbar.trough -sticky ew -children {
Horizontal.Scrollbar.thumb -expand true
}
}
ttk::style layout TCombobox {
Combobox.field -children {
Combobox.downarrow -side right -sticky {}
Combobox.padding -expand 1 -children {
Combobox.textarea
}
}
}
ttk::style layout TSpinbox {
Spinbox.field -children {
null -side right -sticky {} -children {
Spinbox.uparrow -side top
Spinbox.downarrow -side bottom
}
Spinbox.padding -expand 0 -children {
Spinbox.textarea
}
}
}
ttk::style layout Horizontal.TSeparator {
Horizontal.separator -sticky nswe
}
ttk::style layout Vertical.TSeparator {
Vertical.separator -sticky nswe
}
ttk::style layout TLabelframe {
Labelframe.border {
Labelframe.padding -expand 1 -children {
Labelframe.label -side right
}
}
}
ttk::style layout TNotebook.Tab {
Notebook.tab -children {
Notebook.padding -side top -children {
Notebook.label -side top -sticky {}
}
}
}
ttk::style layout Treeview.Item {
Treeitem.padding -sticky nswe -children {
Treeitem.indicator -side left -sticky {}
Treeitem.image -side left -sticky {}
Treeitem.text -side left -sticky {}
}
}
# Elements
# Button
ttk::style configure TButton -padding {8 4 8 4} -width -10 -anchor center
ttk::style element create Button.button image \
[list $I(rect-basic) \
disabled $I(rect-basic) \
pressed $I(rect-basic) \
active $I(button-hover) \
] -border 4 -sticky ewns
# Toolbutton
ttk::style configure Toolbutton -padding {8 4 8 4} -width -10 -anchor center
ttk::style element create Toolbutton.button image \
[list $I(empty) \
disabled $I(empty) \
pressed $I(rect-basic) \
active $I(rect-basic) \
] -border 4 -sticky ewns
# Menubutton
ttk::style configure TMenubutton -padding {8 4 4 4}
ttk::style element create Menubutton.button \
image [list $I(rect-basic) \
disabled $I(rect-basic) \
pressed $I(rect-basic) \
active $I(button-hover) \
] -border 4 -sticky ewns
ttk::style element create Menubutton.indicator \
image [list $I(down) \
active $I(down) \
pressed $I(down) \
disabled $I(down) \
] -width 15 -sticky e
# OptionMenu
ttk::style configure TOptionMenu -padding {8 4 4 4}
ttk::style element create OptionMenu.button \
image [list $I(rect-basic) \
disabled $I(rect-basic) \
pressed $I(rect-basic) \
active $I(button-hover) \
] -border 4 -sticky ewns
ttk::style element create OptionMenu.indicator \
image [list $I(down) \
active $I(down) \
pressed $I(down) \
disabled $I(down) \
] -width 15 -sticky e
# AccentButton
ttk::style configure AccentButton -padding {8 4 8 4} -width -10 -anchor center
ttk::style element create AccentButton.button image \
[list $I(rect-accent) \
disabled $I(rect-accent-hover) \
pressed $I(rect-accent) \
active $I(rect-accent-hover) \
] -border 4 -sticky ewns
# Checkbutton
ttk::style configure TCheckbutton -padding 4
ttk::style element create Checkbutton.indicator image \
[list $I(box-basic) \
{selected disabled} $I(check-basic) \
disabled $I(box-basic) \
{pressed alternate} $I(tri-hover) \
{active alternate} $I(tri-hover) \
alternate $I(tri-accent) \
{pressed selected} $I(check-hover) \
{active selected} $I(check-hover) \
selected $I(check-accent) \
{pressed !selected} $I(rect-hover) \
active $I(box-hover) \
] -width 26 -sticky w
# Switch
ttk::style element create Switch.indicator image \
[list $I(off-basic) \
{selected disabled} $I(on-basic) \
disabled $I(off-basic) \
{pressed selected} $I(on-hover) \
{active selected} $I(on-hover) \
selected $I(on-accent) \
{pressed !selected} $I(off-hover) \
active $I(off-hover) \
] -width 46 -sticky w
# ToggleButton
ttk::style configure ToggleButton -padding {8 4 8 4} -width -10 -anchor center
ttk::style element create ToggleButton.button image \
[list $I(rect-basic) \
{selected disabled} $I(rect-accent-hover) \
disabled $I(rect-basic) \
{pressed selected} $I(rect-basic) \
{active selected} $I(rect-accent) \
selected $I(rect-accent) \
{pressed !selected} $I(rect-accent) \
active $I(rect-basic) \
] -border 4 -sticky ewns
# Radiobutton
ttk::style configure TRadiobutton -padding 4
ttk::style element create Radiobutton.indicator image \
[list $I(outline-basic) \
{selected disabled} $I(radio-basic) \
disabled $I(outline-basic) \
{pressed selected} $I(radio-hover) \
{active selected} $I(radio-hover) \
selected $I(radio-accent) \
{pressed !selected} $I(circle-hover) \
active $I(outline-hover) \
] -width 26 -sticky w
# Scrollbar
ttk::style element create Horizontal.Scrollbar.trough image $I(hor-basic) \
-sticky ew
ttk::style element create Horizontal.Scrollbar.thumb \
image [list $I(hor-accent) \
disabled $I(hor-basic) \
pressed $I(hor-hover) \
active $I(hor-hover) \
] -sticky ew
ttk::style element create Vertical.Scrollbar.trough image $I(vert-basic) \
-sticky ns
ttk::style element create Vertical.Scrollbar.thumb \
image [list $I(vert-accent) \
disabled $I(vert-basic) \
pressed $I(vert-hover) \
active $I(vert-hover) \
] -sticky ns
# Scale
ttk::style element create Horizontal.Scale.trough image $I(hor-basic) \
-border 5 -padding 0
ttk::style element create Horizontal.Scale.slider \
image [list $I(circle-accent) \
disabled $I(circle-basic) \
pressed $I(circle-hover) \
active $I(circle-hover) \
] -sticky {}
ttk::style element create Vertical.Scale.trough image $I(vert-basic) \
-border 5 -padding 0
ttk::style element create Vertical.Scale.slider \
image [list $I(circle-accent) \
disabled $I(circle-basic) \
pressed $I(circle-hover) \
active $I(circle-hover) \
] -sticky {}
# Progressbar
ttk::style element create Horizontal.Progressbar.trough image $I(hor-basic) \
-sticky ew
ttk::style element create Horizontal.Progressbar.pbar image $I(hor-accent) \
-sticky ew
ttk::style element create Vertical.Progressbar.trough image $I(vert-basic) \
-sticky ns
ttk::style element create Vertical.Progressbar.pbar image $I(vert-accent) \
-sticky ns
# Entry
ttk::style element create Entry.field \
image [list $I(box-basic) \
{focus hover} $I(box-accent) \
invalid $I(box-invalid) \
disabled $I(box-basic) \
focus $I(box-accent) \
hover $I(box-hover) \
] -border 5 -padding {8} -sticky news
# Combobox
ttk::style map TCombobox -selectbackground [list \
{!focus} $colors(-selectbg) \
{readonly hover} $colors(-selectbg) \
{readonly focus} $colors(-selectbg) \
]
ttk::style map TCombobox -selectforeground [list \
{!focus} $colors(-selectfg) \
{readonly hover} $colors(-selectfg) \
{readonly focus} $colors(-selectfg) \
]
ttk::style element create Combobox.field \
image [list $I(box-basic) \
{readonly disabled} $I(rect-basic) \
{readonly pressed} $I(rect-basic) \
{readonly focus hover} $I(button-hover) \
{readonly focus} $I(rect-basic) \
{readonly hover} $I(button-hover) \
{focus hover} $I(box-accent) \
readonly $I(rect-basic) \
disabled $I(box-basic) \
focus $I(box-accent) \
hover $I(box-hover) \
] -border 5 -padding {8}
ttk::style element create Combobox.downarrow image $I(down) \
-width 15 -sticky e
# Spinbox
ttk::style element create Spinbox.field \
image [list $I(box-basic) \
disabled $I(box-basic) \
focus $I(box-accent) \
hover $I(box-hover) \
] -border 5 -padding {8} -sticky news
ttk::style element create Spinbox.uparrow \
image [list $I(up) \
disabled $I(up) \
pressed $I(up-accent) \
active $I(up-accent) \
] -border 4 -width 15 -sticky e
ttk::style element create Spinbox.downarrow \
image [list $I(down) \
disabled $I(down) \
pressed $I(down-accent) \
active $I(down-accent) \
] -border 4 -width 15 -sticky e
# Sizegrip
ttk::style element create Sizegrip.sizegrip image $I(size) \
-sticky ewns
# Separator
ttk::style element create Horizontal.separator image $I(separator)
ttk::style element create Vertical.separator image $I(separator)
# Labelframe
ttk::style element create Labelframe.border image $I(box-basic) \
-border 5 -padding 4 -sticky news
# Notebook
ttk::style element create Notebook.client \
image $I(notebook) -border 4
ttk::style element create Notebook.tab \
image [list $I(tab-disabled) \
selected $I(tab-basic) \
active $I(tab-hover) \
] -border 5 -padding {12 4}
# Treeview
ttk::style element create Treeview.field image $I(box-basic) \
-border 5
ttk::style element create Treeheading.cell \
image [list $I(tree-basic) \
pressed $I(tree-pressed)
] -border 5 -padding 4 -sticky ewns
ttk::style element create Treeitem.indicator \
image [list $I(right) \
user2 $I(empty) \
user1 $I(down) \
] -width 15 -sticky w
ttk::style configure Treeview -background $colors(-bg)
ttk::style configure Treeview.Item -padding {2 0 0 0}
ttk::style map Treeview \
-background [list selected $colors(-selectbg)] \
-foreground [list selected $colors(-selectfg)]
# Sashes
ttk::style configure TPanedwindow \
-width 1 -padding 0
ttk::style map TPanedwindow \
-background [list hover $colors(-bg)]
}
}