2 # Settings for Microsoft Windows Vista and Server 2008
5 # The Vista theme can only be defined on Windows Vista and above. The theme
6 # is created in C due to the need to assign a theme-enabled function for
7 # detecting when themeing is disabled. On systems that cannot support the
8 # Vista theme, there will be no such theme created and we must not
9 # evaluate this script.
11 if {"vista" ni
[ttk
::style theme names
]} {
15 namespace eval ttk
::theme::vista {
17 ttk
::style theme settings vista
{
19 # We should ask the system for these, but for now...
21 SM_CXVSCROLL
17 SM_CYVSCROLL
0
22 SM_CXHSCROLL
0 SM_CYHSCROLL
17
24 set cx
[expr {[dict get
$SM SM_CXVSCROLL
] / 2}]
25 set cy
[expr {[dict get
$SM SM_CYVSCROLL
] / 2}]
27 ttk
::style configure .
\
28 -background SystemButtonFace
\
29 -foreground SystemWindowText
\
30 -selectforeground SystemHighlightText
\
31 -selectbackground SystemHighlight
\
36 -foreground [list disabled SystemGrayText
] \
39 ttk
::style configure TButton
-anchor center
-padding {1 1} -width -11
40 ttk
::style configure TRadiobutton
-padding 2
41 ttk
::style configure TCheckbutton
-padding 2
42 ttk
::style configure TMenubutton
-padding {8 4}
44 ttk
::style element create Menubutton.dropdown vsapi
\
45 TOOLBAR
4 {{selected active
} 6 {selected
!active
} 5
46 disabled
4 pressed
3 active
2 {} 1} \
47 -padding [list $cx $cy]
49 ttk
::style configure TNotebook
-tabmargins {2 2 2 0}
50 ttk
::style map TNotebook.Tab
\
51 -expand [list selected
{2 2 2 2}]
54 ttk
::style configure Heading
-font TkHeadingFont
55 ttk
::style configure Treeview
-background SystemWindow
56 ttk
::style map Treeview
\
57 -background [list selected SystemHighlight
] \
58 -foreground [list selected SystemHighlightText
] ;
60 # Label and Toolbutton
61 ttk
::style configure TLabelframe.Label
-foreground "#0046d5"
63 ttk
::style configure Toolbutton
-padding {4 4}
66 ttk
::style configure TCombobox
-padding 2
67 ttk
::style element create Combobox.field vsapi
\
69 ttk
::style element create Combobox.border vsapi
\
70 COMBOBOX
4 {disabled
4 focus 3 active
2 hover
2 {} 1}
71 ttk
::style element create Combobox.rightdownarrow vsapi
\
72 COMBOBOX
6 {disabled
4 pressed
3 active
2 {} 1} \
73 -padding [list $cx $cy]
74 ttk
::style layout TCombobox
{
75 Combobox.border
-sticky nswe
-border 0 -children {
76 Combobox.rightdownarrow
-side right
-sticky ns
77 Combobox.padding
-expand 1 -sticky nswe
-children {
78 Combobox.
focus -expand 1 -sticky nswe
-children {
79 Combobox.textarea
-sticky nswe
84 # Vista.Combobox droplist frame
85 ttk
::style element create ComboboxPopdownFrame.background vsapi
\
86 LISTBOX
3 {disabled
4 active
3 focus 2 {} 1}
87 ttk
::style layout ComboboxPopdownFrame
{
88 ComboboxPopdownFrame.background
-sticky news
-border 1 -children {
89 ComboboxPopdownFrame.padding
-sticky news
92 ttk
::style map TCombobox
\
93 -selectbackground [list !focus SystemWindow
] \
94 -selectforeground [list !focus SystemWindowText
] \
96 disabled SystemGrayText
\
97 {readonly
focus} SystemHighlightText
\
99 -focusfill [list {readonly
focus} SystemHighlight
] \
103 ttk
::style configure TEntry
-padding {1 1 1 1} ;# Needs lookup
104 ttk
::style element create Entry.field vsapi
\
105 EDIT
6 {disabled
4 focus 3 hover
2 {} 1} -padding {2 2 2 2}
106 ttk
::style element create Entry.background vsapi
\
107 EDIT
3 {disabled
3 readonly
3 focus 4 hover
2 {} 1}
108 ttk
::style layout TEntry
{
109 Entry.field
-sticky news
-border 0 -children {
110 Entry.background
-sticky news
-children {
111 Entry.padding
-sticky news
-children {
112 Entry.textarea
-sticky news
117 ttk
::style map TEntry
\
118 -selectbackground [list !focus SystemWindow
] \
119 -selectforeground [list !focus SystemWindowText
] \
123 ttk
::style configure TSpinbox
-padding 0 ;#{2 0 15 1}
124 ttk
::style element create Spinbox.field vsapi
\
125 EDIT
9 {disabled
4 focus 3 hover
2 {} 1} -padding {1 1 1 2}
126 ttk
::style element create Spinbox.background vsapi
\
127 EDIT
3 {disabled
3 readonly
3 focus 4 hover
2 {} 1}
128 ttk
::style element create Spinbox.innerbg vsapi
\
129 EDIT
3 {disabled
3 readonly
3 focus 4 hover
2 {} 1}\
131 ttk
::style element create Spinbox.uparrow vsapi
\
132 SPIN
1 {disabled
4 pressed
3 active
2 {} 1} \
134 ttk
::style element create Spinbox.downarrow vsapi
\
135 SPIN
2 {disabled
4 pressed
3 active
2 {} 1} \
137 ttk
::style layout TSpinbox
{
138 Spinbox.field
-sticky nswe
-children {
139 Spinbox.background
-sticky news
-children {
140 Spinbox.padding
-sticky news
-children {
141 Spinbox.innerbg
-sticky news
-children {
142 Spinbox.textarea
-expand 1 -sticky {}
145 Spinbox.uparrow
-side top
-sticky ens
146 Spinbox.downarrow
-side bottom
-sticky ens
150 ttk
::style map TSpinbox
\
151 -selectbackground [list !focus SystemWindow
] \
152 -selectforeground [list !focus SystemWindowText
] \
156 # SCROLLBAR elements (Vista includes a state for 'hover')
157 ttk
::style element create Vertical.Scrollbar.uparrow vsapi
\
158 SCROLLBAR
1 {disabled
4 pressed
3 active
2 hover
17 {} 1}
159 ttk
::style element create Vertical.Scrollbar.downarrow vsapi
\
160 SCROLLBAR
1 {disabled
8 pressed
7 active
6 hover
18 {} 5}
161 ttk
::style element create Vertical.Scrollbar.trough vsapi
\
162 SCROLLBAR
7 {disabled
4 pressed
3 active
2 hover
5 {} 1}
163 ttk
::style element create Vertical.Scrollbar.thumb vsapi
\
164 SCROLLBAR
3 {disabled
4 pressed
3 active
2 hover
5 {} 1}
165 ttk
::style element create Vertical.Scrollbar.grip vsapi
\
166 SCROLLBAR
9 {disabled
4 pressed
3 active
2 hover
5 {} 1}
167 ttk
::style element create Horizontal.Scrollbar.leftarrow vsapi
\
168 SCROLLBAR
1 {disabled
12 pressed
11 active
10 hover
19 {} 9}
169 ttk
::style element create Horizontal.Scrollbar.rightarrow vsapi
\
170 SCROLLBAR
1 {disabled
16 pressed
15 active
14 hover
20 {} 13}
171 ttk
::style element create Horizontal.Scrollbar.trough vsapi
\
172 SCROLLBAR
5 {disabled
4 pressed
3 active
2 hover
5 {} 1}
173 ttk
::style element create Horizontal.Scrollbar.thumb vsapi
\
174 SCROLLBAR
2 {disabled
4 pressed
3 active
2 hover
5 {} 1}
175 ttk
::style element create Horizontal.Scrollbar.grip vsapi
\
176 SCROLLBAR
8 {disabled
4 pressed
3 active
2 hover
5 {} 1}
179 ttk
::style element create Horizontal.Progressbar.pbar vsapi
\
180 PROGRESS
3 {{} 1} -padding 8
181 ttk
::style layout Horizontal.TProgressbar
{
182 Horizontal.Progressbar.trough
-sticky nswe
-children {
183 Horizontal.Progressbar.pbar
-side left
-sticky ns
186 ttk
::style element create Vertical.Progressbar.pbar vsapi
\
187 PROGRESS
3 {{} 1} -padding 8
188 ttk
::style layout Vertical.TProgressbar
{
189 Vertical.Progressbar.trough
-sticky nswe
-children {
190 Vertical.Progressbar.pbar
-side bottom
-sticky we
195 ttk
::style element create Horizontal.Scale.slider vsapi
\
196 TRACKBAR
3 {disabled
5 focus 4 pressed
3 active
2 {} 1} \
198 ttk
::style layout Horizontal.TScale
{
199 Scale.
focus -expand 1 -sticky nswe
-children {
200 Horizontal.Scale.trough
-expand 1 -sticky nswe
-children {
201 Horizontal.Scale.track
-sticky we
202 Horizontal.Scale.slider
-side left
-sticky {}
206 ttk
::style element create Vertical.Scale.slider vsapi
\
207 TRACKBAR
6 {disabled
5 focus 4 pressed
3 active
2 {} 1} \
209 ttk
::style layout Vertical.TScale
{
210 Scale.
focus -expand 1 -sticky nswe
-children {
211 Vertical.Scale.trough
-expand 1 -sticky nswe
-children {
212 Vertical.Scale.track
-sticky ns
213 Vertical.Scale.slider
-side top
-sticky {}
219 ttk
::style configure Item
-padding {4 0 0 0}
221 unset -nocomplain cx cy
222 package provide ttk
::theme::vista 1.0