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