vistaTheme.tcl (9670B)
1 # 2 # Settings for Microsoft Windows Vista and Server 2008 3 # 4 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. 10 11 if {"vista" ni [ttk::style theme names]} { 12 return 13 } 14 15 namespace eval ttk::theme::vista { 16 17 ttk::style theme settings vista { 18 19 ttk::style configure . \ 20 -background SystemButtonFace \ 21 -foreground SystemWindowText \ 22 -selectforeground SystemHighlightText \ 23 -selectbackground SystemHighlight \ 24 -insertcolor SystemWindowText \ 25 -font TkDefaultFont \ 26 ; 27 28 ttk::style map "." \ 29 -foreground [list disabled SystemGrayText] \ 30 ; 31 32 ttk::style configure TButton -anchor center -padding {1 1} -width -11 33 ttk::style configure TRadiobutton -padding 2 34 ttk::style configure TCheckbutton -padding 2 35 ttk::style configure TMenubutton -padding {8 4} 36 37 ttk::style element create Menubutton.dropdown vsapi \ 38 TOOLBAR 4 {{selected active} 6 {selected !active} 5 39 disabled 4 pressed 3 active 2 {} 1} \ 40 -syssize {SM_CXVSCROLL SM_CYVSCROLL} 41 42 ttk::style configure TNotebook -tabmargins {2 2 2 0} 43 ttk::style map TNotebook.Tab \ 44 -expand [list selected {2 2 2 2}] 45 46 # Treeview: 47 ttk::style configure Heading -font TkHeadingFont 48 ttk::style configure Treeview -background SystemWindow 49 ttk::style map Treeview \ 50 -background [list disabled SystemButtonFace \ 51 {!disabled !selected} SystemWindow \ 52 selected SystemHighlight] \ 53 -foreground [list disabled SystemGrayText \ 54 {!disabled !selected} SystemWindowText \ 55 selected SystemHighlightText] 56 57 # Label and Toolbutton 58 ttk::style configure TLabelframe.Label -foreground SystemButtonText 59 60 ttk::style configure Toolbutton -padding {4 4} 61 62 # Combobox 63 ttk::style configure TCombobox -padding 2 64 ttk::style element create Combobox.border vsapi \ 65 COMBOBOX 4 {disabled 4 focus 3 active 2 hover 2 {} 1} 66 ttk::style element create Combobox.background vsapi \ 67 EDIT 3 {disabled 3 readonly 5 focus 4 hover 2 {} 1} 68 ttk::style element create Combobox.rightdownarrow vsapi \ 69 COMBOBOX 6 {disabled 4 pressed 3 active 2 {} 1} \ 70 -syssize {SM_CXVSCROLL SM_CYVSCROLL} 71 ttk::style layout TCombobox { 72 Combobox.border -sticky nswe -border 0 -children { 73 Combobox.rightdownarrow -side right -sticky ns 74 Combobox.padding -expand 1 -sticky nswe -children { 75 Combobox.background -sticky nswe -children { 76 Combobox.focus -expand 1 -sticky nswe -children { 77 Combobox.textarea -sticky nswe 78 } 79 } 80 } 81 } 82 } 83 # Vista.Combobox droplist frame 84 ttk::style element create ComboboxPopdownFrame.background vsapi\ 85 LISTBOX 3 {disabled 4 active 3 focus 2 {} 1} 86 ttk::style layout ComboboxPopdownFrame { 87 ComboboxPopdownFrame.background -sticky news -border 1 -children { 88 ComboboxPopdownFrame.padding -sticky news 89 } 90 } 91 ttk::style map TCombobox \ 92 -selectbackground [list !focus SystemWindow] \ 93 -selectforeground [list !focus SystemWindowText] \ 94 -foreground [list \ 95 disabled SystemGrayText \ 96 {readonly focus} SystemHighlightText \ 97 ] \ 98 -focusfill [list {readonly focus} SystemHighlight] \ 99 ; 100 101 # Entry 102 ttk::style configure TEntry -padding {1 1 1 1} ;# Needs lookup 103 ttk::style element create Entry.field vsapi \ 104 EDIT 6 {disabled 4 focus 3 hover 2 {} 1} -padding {2 2 2 2} 105 ttk::style element create Entry.background vsapi \ 106 EDIT 3 {disabled 3 readonly 3 focus 4 hover 2 {} 1} 107 ttk::style layout TEntry { 108 Entry.field -sticky news -border 0 -children { 109 Entry.background -sticky news -children { 110 Entry.padding -sticky news -children { 111 Entry.textarea -sticky news 112 } 113 } 114 } 115 } 116 ttk::style map TEntry \ 117 -selectbackground [list !focus SystemWindow] \ 118 -selectforeground [list !focus SystemWindowText] \ 119 ; 120 121 # Spinbox 122 ttk::style configure TSpinbox -padding 0 123 ttk::style element create Spinbox.field vsapi \ 124 EDIT 9 {disabled 4 focus 3 hover 2 {} 1} -padding {1 1 1 2} 125 ttk::style element create Spinbox.background vsapi \ 126 EDIT 3 {disabled 3 readonly 3 focus 4 hover 2 {} 1} 127 ttk::style element create Spinbox.innerbg vsapi \ 128 EDIT 3 {disabled 3 readonly 3 focus 4 hover 2 {} 1}\ 129 -padding {2 0 15 2} 130 ttk::style element create Spinbox.uparrow vsapi \ 131 SPIN 1 {disabled 4 pressed 3 active 2 {} 1} \ 132 -padding 1 -halfheight 1 \ 133 -syssize { SM_CXVSCROLL SM_CYVSCROLL } 134 ttk::style element create Spinbox.downarrow vsapi \ 135 SPIN 2 {disabled 4 pressed 3 active 2 {} 1} \ 136 -padding 1 -halfheight 1 \ 137 -syssize { SM_CXVSCROLL SM_CYVSCROLL } 138 ttk::style layout TSpinbox { 139 Spinbox.field -sticky nswe -children { 140 Spinbox.background -sticky news -children { 141 Spinbox.padding -sticky news -children { 142 Spinbox.innerbg -sticky news -children { 143 Spinbox.textarea -expand 1 144 } 145 } 146 Spinbox.uparrow -side top -sticky ens 147 Spinbox.downarrow -side bottom -sticky ens 148 } 149 } 150 } 151 ttk::style map TSpinbox \ 152 -selectbackground [list !focus SystemWindow] \ 153 -selectforeground [list !focus SystemWindowText] \ 154 ; 155 156 157 # SCROLLBAR elements (Vista includes a state for 'hover') 158 ttk::style element create Vertical.Scrollbar.uparrow vsapi \ 159 SCROLLBAR 1 {disabled 4 pressed 3 active 2 hover 17 {} 1} \ 160 -syssize {SM_CXVSCROLL SM_CYVSCROLL} 161 ttk::style element create Vertical.Scrollbar.downarrow vsapi \ 162 SCROLLBAR 1 {disabled 8 pressed 7 active 6 hover 18 {} 5} \ 163 -syssize {SM_CXVSCROLL SM_CYVSCROLL} 164 ttk::style element create Vertical.Scrollbar.trough vsapi \ 165 SCROLLBAR 7 {disabled 4 pressed 3 active 2 hover 5 {} 1} 166 ttk::style element create Vertical.Scrollbar.thumb vsapi \ 167 SCROLLBAR 3 {disabled 4 pressed 3 active 2 hover 5 {} 1} \ 168 -syssize {SM_CXVSCROLL SM_CYVSCROLL} 169 ttk::style element create Vertical.Scrollbar.grip vsapi \ 170 SCROLLBAR 9 {disabled 4 pressed 3 active 2 hover 5 {} 1} \ 171 -syssize {SM_CXVSCROLL SM_CYVSCROLL} 172 ttk::style element create Horizontal.Scrollbar.leftarrow vsapi \ 173 SCROLLBAR 1 {disabled 12 pressed 11 active 10 hover 19 {} 9} \ 174 -syssize {SM_CXHSCROLL SM_CYHSCROLL} 175 ttk::style element create Horizontal.Scrollbar.rightarrow vsapi \ 176 SCROLLBAR 1 {disabled 16 pressed 15 active 14 hover 20 {} 13} \ 177 -syssize {SM_CXHSCROLL SM_CYHSCROLL} 178 ttk::style element create Horizontal.Scrollbar.trough vsapi \ 179 SCROLLBAR 5 {disabled 4 pressed 3 active 2 hover 5 {} 1} 180 ttk::style element create Horizontal.Scrollbar.thumb vsapi \ 181 SCROLLBAR 2 {disabled 4 pressed 3 active 2 hover 5 {} 1} \ 182 -syssize {SM_CXHSCROLL SM_CYHSCROLL} 183 ttk::style element create Horizontal.Scrollbar.grip vsapi \ 184 SCROLLBAR 8 {disabled 4 pressed 3 active 2 hover 5 {} 1} 185 186 # Progressbar 187 ttk::style element create Horizontal.Progressbar.pbar vsapi \ 188 PROGRESS 3 {{} 1} -padding 8 189 ttk::style layout Horizontal.TProgressbar { 190 Horizontal.Progressbar.trough -sticky nswe -children { 191 Horizontal.Progressbar.pbar -side left -sticky ns 192 } 193 } 194 ttk::style element create Vertical.Progressbar.pbar vsapi \ 195 PROGRESS 3 {{} 1} -padding 8 196 ttk::style layout Vertical.TProgressbar { 197 Vertical.Progressbar.trough -sticky nswe -children { 198 Vertical.Progressbar.pbar -side bottom -sticky we 199 } 200 } 201 202 # Scale 203 ttk::style element create Horizontal.Scale.slider vsapi \ 204 TRACKBAR 3 {disabled 5 focus 4 pressed 3 active 2 {} 1} \ 205 -width 6 -height 12 206 ttk::style layout Horizontal.TScale { 207 Scale.focus -expand 1 -sticky nswe -children { 208 Horizontal.Scale.trough -expand 1 -sticky nswe -children { 209 Horizontal.Scale.track -sticky we 210 Horizontal.Scale.slider -side left -sticky {} 211 } 212 } 213 } 214 ttk::style element create Vertical.Scale.slider vsapi \ 215 TRACKBAR 6 {disabled 5 focus 4 pressed 3 active 2 {} 1} \ 216 -width 12 -height 6 217 ttk::style layout Vertical.TScale { 218 Scale.focus -expand 1 -sticky nswe -children { 219 Vertical.Scale.trough -expand 1 -sticky nswe -children { 220 Vertical.Scale.track -sticky ns 221 Vertical.Scale.slider -side top -sticky {} 222 } 223 } 224 } 225 226 # Treeview 227 ttk::style configure Item -padding {4 0 0 0} 228 229 package provide ttk::theme::vista 1.0 230 } 231 }