clamTheme.tcl 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. #
  2. # "Clam" theme.
  3. #
  4. # Inspired by the XFCE family of Gnome themes.
  5. #
  6. namespace eval ttk::theme::clam {
  7. variable colors
  8. array set colors {
  9. -disabledfg "#999999"
  10. -frame "#dcdad5"
  11. -window "#ffffff"
  12. -dark "#cfcdc8"
  13. -darker "#bab5ab"
  14. -darkest "#9e9a91"
  15. -lighter "#eeebe7"
  16. -lightest "#ffffff"
  17. -selectbg "#4a6984"
  18. -selectfg "#ffffff"
  19. }
  20. ttk::style theme settings clam {
  21. ttk::style configure "." \
  22. -background $colors(-frame) \
  23. -foreground black \
  24. -bordercolor $colors(-darkest) \
  25. -darkcolor $colors(-dark) \
  26. -lightcolor $colors(-lighter) \
  27. -troughcolor $colors(-darker) \
  28. -selectbackground $colors(-selectbg) \
  29. -selectforeground $colors(-selectfg) \
  30. -selectborderwidth 0 \
  31. -font TkDefaultFont \
  32. ;
  33. ttk::style map "." \
  34. -background [list disabled $colors(-frame) \
  35. active $colors(-lighter)] \
  36. -foreground [list disabled $colors(-disabledfg)] \
  37. -selectbackground [list !focus $colors(-darkest)] \
  38. -selectforeground [list !focus white] \
  39. ;
  40. # -selectbackground [list !focus "#847d73"]
  41. ttk::style configure TButton \
  42. -anchor center -width -11 -padding 5 -relief raised
  43. ttk::style map TButton \
  44. -background [list \
  45. disabled $colors(-frame) \
  46. pressed $colors(-darker) \
  47. active $colors(-lighter)] \
  48. -lightcolor [list pressed $colors(-darker)] \
  49. -darkcolor [list pressed $colors(-darker)] \
  50. -bordercolor [list alternate "#000000"] \
  51. ;
  52. ttk::style configure Toolbutton \
  53. -anchor center -padding 2 -relief flat
  54. ttk::style map Toolbutton \
  55. -relief [list \
  56. disabled flat \
  57. selected sunken \
  58. pressed sunken \
  59. active raised] \
  60. -background [list \
  61. disabled $colors(-frame) \
  62. pressed $colors(-darker) \
  63. active $colors(-lighter)] \
  64. -lightcolor [list pressed $colors(-darker)] \
  65. -darkcolor [list pressed $colors(-darker)] \
  66. ;
  67. ttk::style configure TCheckbutton \
  68. -indicatorbackground "#ffffff" \
  69. -indicatormargin {1 1 4 1} \
  70. -padding 2 ;
  71. ttk::style configure TRadiobutton \
  72. -indicatorbackground "#ffffff" \
  73. -indicatormargin {1 1 4 1} \
  74. -padding 2 ;
  75. ttk::style map TCheckbutton -indicatorbackground \
  76. [list disabled $colors(-frame) pressed $colors(-frame)]
  77. ttk::style map TRadiobutton -indicatorbackground \
  78. [list disabled $colors(-frame) pressed $colors(-frame)]
  79. ttk::style configure TMenubutton \
  80. -width -11 -padding 5 -relief raised
  81. ttk::style configure TEntry -padding 1 -insertwidth 1
  82. ttk::style map TEntry \
  83. -background [list readonly $colors(-frame)] \
  84. -bordercolor [list focus $colors(-selectbg)] \
  85. -lightcolor [list focus "#6f9dc6"] \
  86. -darkcolor [list focus "#6f9dc6"] \
  87. ;
  88. ttk::style configure TCombobox -padding 1 -insertwidth 1
  89. ttk::style map TCombobox \
  90. -background [list active $colors(-lighter) \
  91. pressed $colors(-lighter)] \
  92. -fieldbackground [list {readonly focus} $colors(-selectbg) \
  93. readonly $colors(-frame)] \
  94. -foreground [list {readonly focus} $colors(-selectfg)] \
  95. ;
  96. ttk::style configure ComboboxPopdownFrame \
  97. -relief solid -borderwidth 1
  98. ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0}
  99. ttk::style map TSpinbox \
  100. -background [list readonly $colors(-frame)] \
  101. -arrowcolor [list disabled $colors(-disabledfg)]
  102. ttk::style configure TNotebook.Tab -padding {6 2 6 2}
  103. ttk::style map TNotebook.Tab \
  104. -padding [list selected {6 4 6 2}] \
  105. -background [list selected $colors(-frame) {} $colors(-darker)] \
  106. -lightcolor [list selected $colors(-lighter) {} $colors(-dark)] \
  107. ;
  108. # Treeview:
  109. ttk::style configure Heading \
  110. -font TkHeadingFont -relief raised -padding {3}
  111. ttk::style configure Treeview -background $colors(-window)
  112. ttk::style map Treeview \
  113. -background [list selected $colors(-selectbg)] \
  114. -foreground [list selected $colors(-selectfg)] ;
  115. ttk::style configure TLabelframe \
  116. -labeloutside true -labelmargins {0 0 0 4} \
  117. -borderwidth 2 -relief raised
  118. ttk::style configure TProgressbar -background $colors(-frame)
  119. ttk::style configure Sash -sashthickness 6 -gripcount 10
  120. }
  121. }