classicTheme.tcl (3685B)
1 # 2 # "classic" Tk theme. 3 # 4 # Implements Tk's traditional Motif-like look and feel. 5 # 6 7 namespace eval ttk::theme::classic { 8 9 variable colors; array set colors { 10 -frame "#d9d9d9" 11 -window "#ffffff" 12 -activebg "#ececec" 13 -troughbg "#c3c3c3" 14 -selectbg "#c3c3c3" 15 -selectfg "#000000" 16 -disabledfg "#a3a3a3" 17 -indicator "#b03060" 18 -altindicator "#b05e5e" 19 } 20 21 ttk::style theme settings classic { 22 ttk::style configure "." \ 23 -font TkDefaultFont \ 24 -background $colors(-frame) \ 25 -foreground black \ 26 -selectbackground $colors(-selectbg) \ 27 -selectforeground $colors(-selectfg) \ 28 -troughcolor $colors(-troughbg) \ 29 -indicatorcolor $colors(-frame) \ 30 -highlightcolor $colors(-frame) \ 31 -highlightthickness 1 \ 32 -selectborderwidth 1 \ 33 -insertwidth 2 \ 34 ; 35 36 # To match pre-Xft X11 appearance, use: 37 # ttk::style configure . -font {Helvetica 12 bold} 38 39 ttk::style map "." -background \ 40 [list disabled $colors(-frame) active $colors(-activebg)] 41 ttk::style map "." -foreground \ 42 [list disabled $colors(-disabledfg)] 43 44 ttk::style map "." -highlightcolor [list focus black] 45 46 ttk::style configure TButton \ 47 -anchor center -padding "3m 1m" -relief raised -shiftrelief 1 48 ttk::style map TButton -relief [list {!disabled pressed} sunken] 49 50 ttk::style configure TCheckbutton -indicatorrelief raised 51 ttk::style map TCheckbutton \ 52 -indicatorcolor [list \ 53 pressed $colors(-frame) \ 54 alternate $colors(-altindicator) \ 55 selected $colors(-indicator)] \ 56 -indicatorrelief {alternate raised selected sunken pressed sunken} \ 57 ; 58 59 ttk::style configure TRadiobutton -indicatorrelief raised 60 ttk::style map TRadiobutton \ 61 -indicatorcolor [list \ 62 pressed $colors(-frame) \ 63 alternate $colors(-altindicator) \ 64 selected $colors(-indicator)] \ 65 -indicatorrelief {alternate raised selected sunken pressed sunken} \ 66 ; 67 68 ttk::style configure TMenubutton -relief raised -padding "3m 1m" 69 70 ttk::style configure TEntry -relief sunken -padding 1 -font TkTextFont 71 ttk::style map TEntry -fieldbackground \ 72 [list readonly $colors(-frame) disabled $colors(-frame)] 73 ttk::style configure TCombobox -padding 1 74 ttk::style map TCombobox -fieldbackground \ 75 [list readonly $colors(-frame) disabled $colors(-frame)] 76 ttk::style configure ComboboxPopdownFrame \ 77 -relief solid -borderwidth 1 78 79 ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0} 80 ttk::style map TSpinbox -fieldbackground \ 81 [list readonly $colors(-frame) disabled $colors(-frame)] 82 83 ttk::style configure TLabelframe -borderwidth 2 -relief groove 84 85 ttk::style configure TScrollbar -relief raised 86 ttk::style map TScrollbar -relief {{pressed !disabled} sunken} 87 88 ttk::style configure TScale -sliderrelief raised 89 ttk::style map TScale -sliderrelief {{pressed !disabled} sunken} 90 91 ttk::style configure TProgressbar -background SteelBlue 92 ttk::style configure TNotebook.Tab \ 93 -padding {3m 1m} \ 94 -background $colors(-troughbg) 95 ttk::style map TNotebook.Tab -background [list selected $colors(-frame)] 96 97 # Treeview: 98 ttk::style configure Heading -font TkHeadingFont -relief raised 99 ttk::style configure Treeview -background $colors(-window) 100 ttk::style map Treeview \ 101 -background [list selected $colors(-selectbg)] \ 102 -foreground [list selected $colors(-selectfg)] ; 103 104 # 105 # Toolbar buttons: 106 # 107 ttk::style configure Toolbutton -padding 2 -relief flat -shiftrelief 2 108 ttk::style map Toolbutton -relief \ 109 {disabled flat selected sunken pressed sunken active raised} 110 ttk::style map Toolbutton -background \ 111 [list pressed $colors(-troughbg) active $colors(-activebg)] 112 } 113 }