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