-
Notifications
You must be signed in to change notification settings - Fork 0
/
awblack.tcl
98 lines (89 loc) · 2.84 KB
/
awblack.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
#!/usr/bin/tclsh
#
# black:
# - Added the labelframe box.
# - Changed selection color to match the background color.
# - Scale, progressbar, scrollbar, spinbox button design are different.
# - sizegrip design is different.
#
# 7.8
# - set menu.relief to solid.
set ap [file normalize [file dirname [info script]]]
if { $ap ni $::auto_path } {
lappend ::auto_path $ap
}
set ap [file normalize [file join [file dirname [info script]] .. code]]
if { $ap ni $::auto_path } {
lappend ::auto_path $ap
}
unset ap
package require awthemes
namespace eval ::ttk::theme::awblack {
proc setBaseColors { } {
variable colors
array set colors {
style.arrow solid-bg
style.checkbutton square-x
style.combobox solid-bg
style.radiobutton octagon-circle
style.menubutton solid
style.treeview solid
bg.bg #424242
fg.fg #ffffff
graphics.color #424242
is.dark true
}
}
proc setDerivedColors { } {
variable colors
set colors(bg.darkest) #121212
set colors(border) #000000
set colors(button) $colors(bg.bg)
set colors(border.button) $colors(bg.darkest)
set colors(button.padding) {5 1}
set colors(border.checkbutton) $colors(bg.darker)
set colors(checkbutton.padding) {4 0 0 3}
set colors(checkbutton.scale) 0.7
set colors(combobox.padding) {2 0}
set colors(entrybg.bg) #ffffff
set colors(entryfg.fg) #000000
set colors(entry.padding) {3 0}
set colors(focus.color) #000000
set colors(arrow.color) #000000
set colors(scrollbar.color.grip) #000000
set colors(scrollbar.color.arrow) #000000
set colors(sizegrip.color) #000000
set colors(menu.relief) solid
set colors(menubutton.padding) {5 1}
set colors(menubutton.relief) raised
set colors(menubutton.width) -8
set colors(notebook.tab.focusthickness) 1
set colors(notebook.tab.padding) {4 2 4 2}
set colors(border.scale) $colors(bg.darkest)
set colors(select.bg) $colors(bg.darkest)
set colors(tree.arrow.selected) $colors(fg.fg)
set colors(trough.color) $colors(bg.darkest)
}
proc init { } {
set theme awblack
set version 7.8.1
try {
set ti [image create photo -data {<svg></svg>} -format svg]
image delete $ti
set havetksvg true
} on error {err res} {
lassign [dict get $res -errorcode] a b c d
if { $c ne "PHOTO_FORMAT" } {
set havetksvg true
}
}
if { ([info exists ::notksvg] && $::notksvg) || ! $havetksvg } {
namespace delete ::ttk::theme::${theme}
error "no tksvg package present: cannot load scalable ${theme} theme"
}
package provide ${theme} $version
package provide ttk::theme::${theme} $version
::ttk::awthemes::init ${theme}
}
init
}