Posted to tcl by jenglish at Sat Dec 08 22:14:36 GMT 2007view raw

  1.  
  2. package provide ttk::theme::green 8.5.0
  3.  
  4. namespace eval ttk::theme::green {
  5.  
  6. variable colors
  7. array set colors {
  8. -frame "#bbffbb"
  9. -window "#ffffbd"
  10. -darkest "#4b664b"
  11. -darker "#709970"
  12. -dark "#a8e6a8"
  13. -light "#d2ffd2"
  14. -lighter "#ddffdd"
  15. -disabledfg "#a3a3a3"
  16. -selectbg "#400080"
  17. -selectfg "#ffffff"
  18. }
  19.  
  20. ttk::style theme create green -parent alt -settings {
  21.  
  22. ttk::style configure "." \
  23. -background $colors(-frame) \
  24. -foreground black \
  25. -bordercolor $colors(-darkest) \
  26. -selectbackground $colors(-selectbg) \
  27. -selectforeground $colors(-selectfg) \
  28. -troughcolor $colors(-dark) \
  29. -arrowcolor $colors(-darkest) \
  30. -font TkDefaultFont \
  31. ;
  32.  
  33. ttk::style map "." -background \
  34. [list disabled $colors(-frame) active $colors(-lighter)] ;
  35. ttk::style map "." -foreground [list disabled $colors(-disabledfg)] ;
  36. ttk::style map "." -embossed [list disabled 1] ;
  37.  
  38. ttk::style configure TButton \
  39. -anchor center -width -11 -padding "1 1" \
  40. -relief raised -shiftrelief 1 \
  41. -highlightthickness 1 -highlightcolor $colors(-frame)
  42.  
  43. ttk::style map TButton -relief {
  44. {pressed !disabled} sunken
  45. {active !disabled} raised
  46. } -highlightcolor {alternate black}
  47.  
  48. ttk::style configure TCheckbutton \
  49. -indicatorcolor $colors(-window) -padding 2
  50. ttk::style configure TRadiobutton \
  51. -indicatorcolor $colors(-window) -padding 2
  52. ttk::style map TCheckbutton -indicatorcolor \
  53. [list disabled $colors(-frame) pressed $colors(-frame)]
  54. ttk::style map TRadiobutton -indicatorcolor \
  55. [list disabled $colors(-frame) pressed $colors(-frame)]
  56.  
  57. ttk::style configure TMenubutton \
  58. -width -11 -padding "3 3" -relief raised
  59.  
  60. ttk::style configure TEntry \
  61. -padding 1 -fieldbackground $colors(-window) ;
  62. ttk::style map TEntry -fieldbackground \
  63. [list readonly $colors(-frame) disabled $colors(-frame)]
  64. ttk::style configure TCombobox \
  65. -padding 1 -fieldbackground $colors(-window) ;
  66. ttk::style map TCombobox -fieldbackground \
  67. [list readonly $colors(-frame) disabled $colors(-frame)]
  68.  
  69. ttk::style configure Toolbutton -relief flat -padding 2
  70. ttk::style map Toolbutton -relief \
  71. {disabled flat selected sunken pressed sunken active raised}
  72. ttk::style map Toolbutton -background \
  73. [list pressed $colors(-dark) active $colors(-light)]
  74.  
  75. ttk::style configure TScrollbar -relief raised
  76. ttk::style configure TScale \
  77. -groovewidth 4 -troughrelief sunken \
  78. -sliderwidth raised -borderwidth 2
  79. ttk::style configure TProgressbar \
  80. -background $colors(-selectbg) -borderwidth 0
  81.  
  82. ttk::style configure TLabelframe -relief groove -borderwidth 2
  83.  
  84. ttk::style configure TNotebook -tabmargins {2 2 1 0}
  85. ttk::style configure TNotebook.Tab \
  86. -padding {4 2} -background $colors(-dark)
  87. ttk::style map TNotebook.Tab \
  88. -background [list selected $colors(-frame)] \
  89. -expand [list selected {2 2 1 0}] \
  90. ;
  91.  
  92. ttk::style configure Treeview -fieldbackground $colors(-window)
  93. ttk::style configure Heading -font TkHeadingFont -relief raised
  94. ttk::style configure Row -background $colors(-window)
  95. ttk::style map Row \
  96. -background [list selected $colors(-selectbg)]
  97. ttk::style map Item \
  98. -foreground [list selected $colors(-selectfg)]
  99. ttk::style map Cell \
  100. -foreground [list selected $colors(-selectfg)]
  101.  
  102. }
  103. }
  104.  
  105.