blob: a631376575495864ed89317648ec0731951d3d99 (
plain)
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
|
#
# Aqua theme (OSX native look and feel)
#
namespace eval ttk::theme::aqua {
ttk::style theme settings aqua {
ttk::style configure . \
-font TkDefaultFont \
-background systemWindowBackgroundColor \
-foreground systemLabelColor \
-selectbackground systemSelectedTextBackgroundColor \
-selectforeground systemSelectedTextColor \
-insertwidth 1
ttk::style map . \
-foreground {
disabled systemDisabledControlTextColor
background systemLabelColor} \
-selectbackground {
background systemSelectedTextBackgroundColor
!focus systemSelectedTextBackgroundColor} \
-selectforeground {
background systemSelectedTextColor
!focus systemSelectedTextColor}
# Button
ttk::style configure TButton -anchor center \
-foreground systemControlTextColor
ttk::style map TButton \
-foreground {
pressed white
{alternate !pressed !background} white
disabled systemDisabledControlTextColor}
# Menubutton
ttk::style configure TMenubutton -anchor center -padding {2 0 0 2}
# Toolbutton
ttk::style configure Toolbutton -anchor center
# Inline Button
ttk::style configure InlineButton -anchor center -font TkHeadingFont \
-foreground systemTextBackgroundColor
ttk::style map InlineButton \
-foreground {
disabled systemWindowBackgroundColor
}
# Image Button
ttk::style configure ImageButton -anchor center -width 1 \
-compound top
ttk::style map ImageButton \
-foreground {
pressed systemLabelColor
!pressed systemSecondaryLabelColor
}
# Recessed (radio) button
font create RecessedFont -family EmphasizedSystem -size 11 -weight bold
ttk::style configure RecessedButton \
-foreground systemControlTextColor
ttk::style map RecessedButton \
-foreground {
{disabled selected} systemWindowBackgroundColor3
{disabled !selected} systemDisabledControlTextColor
selected systemTextBackgroundColor
active white
pressed white
} \
-font {
selected RecessedFont
active RecessedFont
pressed RecessedFont
}
# Sidebar (radio) button
font create SidebarFont -family .AppleSystemUIFont -size 11 -weight normal
ttk::style configure SidebarButton \
-foreground systemControlTextColor \
-font SidebarFont
ttk::style map SidebarButton \
-foreground {
{disabled selected} systemWindowBackgroundColor3
{disabled !selected} systemDisabledControlTextColor
selected systemTextColor
active systemTextColor
pressed systemTextColor
}
# For Entry, Combobox and Spinbox widgets the selected text background
# is the "Highlight color" selected in preferences when the widget
# has focus. It is a gray color when the widget does not have focus or
# the window does not have focus. (The background state implies !focus
# so we only need to specify !focus.)
# Entry
ttk::style configure TEntry \
-foreground systemTextColor \
-background systemTextBackgroundColor
ttk::style map TEntry \
-foreground {
disabled systemDisabledControlTextColor
} \
-selectbackground {
!focus systemUnemphasizedSelectedTextBackgroundColor
}
# Combobox:
ttk::style map TCombobox \
-foreground {
disabled systemDisabledControlTextColor
} \
-selectbackground {
!focus systemUnemphasizedSelectedTextBackgroundColor
}
# Spinbox
ttk::style configure TSpinbox \
-foreground systemTextColor \
-background systemTextBackgroundColor
ttk::style map TSpinbox \
-foreground {
disabled systemDisabledControlTextColor
} \
-selectbackground {
!focus systemUnemphasizedSelectedTextBackgroundColor
}
# Workaround for #1100117:
# Actually, on Aqua we probably shouldn't stipple images in
# disabled buttons even if it did work...
ttk::style configure . -stipple {}
# Notebook
ttk::style configure TNotebook -tabmargins {10 0} -tabposition n
ttk::style configure TNotebook -padding {18 8 18 17}
ttk::style configure TNotebook.Tab -padding {12 3 12 2}
ttk::style configure TNotebook.Tab -foreground systemControlTextColor
ttk::style map TNotebook.Tab \
-foreground {
{background !selected} systemControlTextColor
{background selected} black
{!background selected} systemSelectedTabTextColor
disabled systemDisabledControlTextColor}
# Treeview:
ttk::style configure Heading \
-font TkHeadingFont \
-foreground systemTextColor \
-background systemWindowBackgroundColor
ttk::style configure Treeview -rowheight 18 \
-background systemControlBackgroundColor \
-stripedbackground systemControlAlternatingRowColor \
-foreground systemTextColor \
-fieldbackground systemTextBackgroundColor
ttk::style map Treeview \
-background {
selected systemSelectedTextBackgroundColor
}
# Enable animation for ttk::progressbar widget:
ttk::style configure TProgressbar -period 100 -maxphase 120
# For Aqua, labelframe labels should appear outside the border,
# with a 14 pixel inset and 4 pixels spacing between border and label
# (ref: Apple Human Interface Guidelines / Controls / Grouping Controls)
#
ttk::style configure TLabelframe \
-labeloutside true \
-labelmargins {14 0 14 2}
ttk::style configure TLabelframe.Label \
-font TkSmallCaptionFont
# TODO: panedwindow sashes should be 9 pixels (HIG:Controls:Split Views)
}
}
|